aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1994-12-13 23:08:12 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1994-12-13 23:08:12 +0000
commit2c17fe9339c079c3dc8fedffc9ebe7ac596929d3 (patch)
tree4ff16e7a84da04a3ac62c765bcf1fbaea433c1ac /sys/netinet
parent652082e6acb1615521cfe65c7013e67df4d84280 (diff)
downloadsrc-2c17fe9339c079c3dc8fedffc9ebe7ac596929d3.tar.gz
src-2c17fe9339c079c3dc8fedffc9ebe7ac596929d3.zip
Call rtalloc_ign() so that protocol cloning will not occur at the IP layer.
Notes
Notes: svn path=/head/; revision=5105
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_input.c10
-rw-r--r--sys/netinet/ip_output.c13
2 files changed, 17 insertions, 6 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 3b2678c30bfb..d99a37a6a402 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 986f9ddaa913..da1a29ab0a15 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;