diff options
author | dg <dg@FreeBSD.org> | 1998-05-19 14:04:36 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1998-05-19 14:04:36 +0000 |
commit | 5f8a4130d8dd1d4441beb5fba01ab53b331a9111 (patch) | |
tree | aaed0538d112feb998dd062f62a7e8e220668f46 /sys/netinet/ip_input.c | |
parent | c3415a2524903047d0a79dad7753c33f98e0f235 (diff) | |
download | FreeBSD-src-5f8a4130d8dd1d4441beb5fba01ab53b331a9111.zip FreeBSD-src-5f8a4130d8dd1d4441beb5fba01ab53b331a9111.tar.gz |
Added fast IP forwarding code by Matt Thomas <matt@3am-software.com> via
NetBSD, ported to FreeBSD by Pierre Beyssac <pb@fasterix.freenix.org> and
minorly tweaked by me.
This is a standard part of FreeBSD, but must be enabled with:
"sysctl -w net.inet.ip.fastforwarding=1" ...and of course forwarding must
also be enabled. This should probably be modified to use the zone
allocator for speed and space efficiency. The current algorithm also
appears to lose if the number of active paths exceeds IPFLOW_MAX (256),
in which case it wastes lots of time trying to figure out which cache
entry to drop.
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 4e07424..5f0eced 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.81 1998/03/30 09:52:56 phk Exp $ + * $Id: ip_input.c,v 1.82 1998/04/13 17:27:08 phk Exp $ * $ANA: ip_input.c,v 1.5 1996/09/18 14:34:59 wollman Exp $ */ @@ -80,7 +80,7 @@ int rsvp_on = 0; static int ip_rsvp_on; struct socket *ip_rsvpd; -static int ipforwarding = 0; +int ipforwarding = 0; SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, &ipforwarding, 0, ""); @@ -878,6 +878,7 @@ ip_slowtimo() } } } + ipflow_slowtimo(); splx(s); } @@ -1381,8 +1382,10 @@ ip_forward(m, srcrt) if (type) ipstat.ips_redirectsent++; else { - if (mcopy) + if (mcopy) { + ipflow_create(&ipforward_rt, mcopy); m_freem(mcopy); + } return; } } |