diff options
author | wollman <wollman@FreeBSD.org> | 1994-12-13 23:08:12 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-12-13 23:08:12 +0000 |
commit | 64047b08297331f960012139161b4b70abc39922 (patch) | |
tree | 4ff16e7a84da04a3ac62c765bcf1fbaea433c1ac | |
parent | 5b021627cb58e592b73df704430e16c2ac153ce0 (diff) | |
download | FreeBSD-src-64047b08297331f960012139161b4b70abc39922.zip FreeBSD-src-64047b08297331f960012139161b4b70abc39922.tar.gz |
Call rtalloc_ign() so that protocol cloning will not occur at the IP layer.
-rw-r--r-- | sys/netinet/ip_input.c | 10 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 13 |
2 files changed, 17 insertions, 6 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 3b2678c..d99a37a 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.11 1994/11/16 10:17:08 jkh Exp $ + * $Id: ip_input.c,v 1.12 1994/12/12 17:20:53 ugen Exp $ */ #include <sys/param.h> @@ -880,7 +880,7 @@ ip_rtaddr(dst) sin->sin_len = sizeof(*sin); sin->sin_addr = dst; - rtalloc(&ipforward_rt); + rtalloc_ign(&ipforward_rt, RTF_PRCLONING); } if (ipforward_rt.ro_rt == 0) return ((struct in_ifaddr *)0); @@ -1051,7 +1051,7 @@ ip_forward(m, srcrt) #ifdef IPFIREWALL if ( ((char *)&(ip->ip_dst.s_addr))[0] != 127 - && !ip_fw_chk(ip,m->m_pkthdr.rcvif,ip_fw_fwd_chain) ) { + && !ip_fw_chk(ip, m->m_pkthdr.rcvif, ip_fw_fwd_chain) ) { ipstat.ips_cantforward++; m_freem(m); return; @@ -1081,7 +1081,7 @@ ip_forward(m, srcrt) sin->sin_len = sizeof(*sin); sin->sin_addr = ip->ip_dst; - rtalloc(&ipforward_rt); + rtalloc_ign(&ipforward_rt, RTF_PRCLONING); if (ipforward_rt.ro_rt == 0) { icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0); return; @@ -1095,10 +1095,12 @@ ip_forward(m, srcrt) */ mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64)); +#ifdef bogus #ifdef GATEWAY ip_ifmatrix[rt->rt_ifp->if_index + if_index * m->m_pkthdr.rcvif->if_index]++; #endif +#endif /* * If forwarding packet using same interface that it came in on, * perhaps should send a redirect to sender to shortcut a hop. diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 986f9dd..da1a29a 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 - * $Id: ip_output.c,v 1.9 1994/11/16 10:17:10 jkh Exp $ + * $Id: ip_output.c,v 1.10 1994/12/12 17:20:54 ugen Exp $ */ #include <sys/param.h> @@ -153,8 +153,17 @@ ip_output(m0, opt, ro, flags, imo) ifp = ia->ia_ifp; ip->ip_ttl = 1; } else { + /* + * If this is the case, we probably don't want to allocate + * a protocol-cloned route since we didn't get one from the + * ULP. This lets TCP do its thing, while not burdening + * forwarding or ICMP with the overhead of cloning a route. + * Of course, we still want to do any cloning requested by + * the link layer, as this is probably required in all cases + * for correct operation (as it is for ARP). + */ if (ro->ro_rt == 0) - rtalloc(ro); + rtalloc_ign(ro, RTF_PRCLONING); if (ro->ro_rt == 0) { ipstat.ips_noroute++; error = EHOSTUNREACH; |