From owner-svn-src-user@FreeBSD.ORG Mon Jun 8 04:53:28 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 7D183106564A; Mon, 8 Jun 2009 04:53:28 +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 6B83F8FC14; Mon, 8 Jun 2009 04:53:28 +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 n584rSeR016334; Mon, 8 Jun 2009 04:53:28 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n584rSHP016333; Mon, 8 Jun 2009 04:53:28 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906080453.n584rSHP016333@svn.freebsd.org> From: Kip Macy Date: Mon, 8 Jun 2009 04:53:28 +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: r193685 - 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 04:53:28 -0000 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++;