svn commit: r193685 - user/kmacy/releng_7_2_fcs/sys/netinet

Kip Macy kmacy at FreeBSD.org
Mon Jun 8 04:53:28 UTC 2009


Author: kmacy
Date: Mon Jun  8 04:53:28 2009
New Revision: 193685
URL: http://svn.freebsd.org/changeset/base/193685

Log:
  use cached ifp if available

Modified:
  user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c

Modified: user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c	Mon Jun  8 04:52:07 2009	(r193684)
+++ user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c	Mon Jun  8 04:53:28 2009	(r193685)
@@ -163,11 +163,11 @@ ip_output(struct mbuf *m, struct mbuf *o
 			m->m_flags |= M_FLOWID;
 		}
 	}
-	if ((ro == &iproute) && (ro->ro_rt == NULL) && (ro->ro_lle == NULL)) {
-		if (flowtable_lookup(ip_ft, m, ro) == 0)
-			nortfree = 1;
+	if (ro == &iproute &&
+	    flowtable_lookup(ip_ft, m, ro) == 0) {
+		nortfree = 1;
+		ifp = ro->ro_rt->rt_ifp;
 	}
-
 	if (opt) {
 		len = 0;
 		m = ip_insertoptions(m, opt, &len);
@@ -175,7 +175,9 @@ ip_output(struct mbuf *m, struct mbuf *o
 			hlen = len;
 	}
 	ip = mtod(m, struct ip *);
-
+	if (nortfree)
+		ip->ip_ttl = 1;
+	
 	/*
 	 * Fill in IP header.  If we are not allowing fragmentation,
 	 * then the ip_id field is meaningless, but we don't set it
@@ -245,7 +247,7 @@ again:
 		ifp = ia->ia_ifp;
 		ip->ip_ttl = 1;
 		isbroadcast = 1;
-	} else if (flags & IP_ROUTETOIF) {
+	} else if (ifp == NULL && (flags & IP_ROUTETOIF)) {
 		if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL &&
 		    (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) {
 			V_ipstat.ips_noroute++;


More information about the svn-src-user mailing list