From owner-svn-src-user@FreeBSD.ORG Mon Jun 8 05:00:33 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D4A106564A; Mon, 8 Jun 2009 05:00:33 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EE78FC17; Mon, 8 Jun 2009 05:00:33 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5850Xk7016527; Mon, 8 Jun 2009 05:00:33 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5850XAn016526; Mon, 8 Jun 2009 05:00:33 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906080500.n5850XAn016526@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Jun 2009 05:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193686 - user/kmacy/releng_7_2_fcs/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 05:00:33 -0000 Author: kmacy Date: Mon Jun 8 05:00:32 2009 New Revision: 193686 URL: http://svn.freebsd.org/changeset/base/193686 Log: cleanup caching of ifp 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:53:28 2009 (r193685) +++ user/kmacy/releng_7_2_fcs/sys/netinet/ip_output.c Mon Jun 8 05:00:32 2009 (r193686) @@ -166,7 +166,6 @@ ip_output(struct mbuf *m, struct mbuf *o if (ro == &iproute && flowtable_lookup(ip_ft, m, ro) == 0) { nortfree = 1; - ifp = ro->ro_rt->rt_ifp; } if (opt) { len = 0; @@ -175,8 +174,6 @@ 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, @@ -247,14 +244,18 @@ again: ifp = ia->ia_ifp; ip->ip_ttl = 1; isbroadcast = 1; - } else if (ifp == NULL && (flags & IP_ROUTETOIF)) { - if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && + } else if (flags & IP_ROUTETOIF) { + if (nortfree == 0 && + (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) { V_ipstat.ips_noroute++; error = ENETUNREACH; goto bad; } - ifp = ia->ia_ifp; + if (nortfree) + ifp = ro->ro_rt->rt_ifp; + else + ifp = ia->ia_ifp; ip->ip_ttl = 1; isbroadcast = in_broadcast(dst->sin_addr, ifp); } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&