From owner-svn-src-head@FreeBSD.ORG Sat May 3 16:28:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDA35312; Sat, 3 May 2014 16:28:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE5121B93; Sat, 3 May 2014 16:28:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43GStFn045296; Sat, 3 May 2014 16:28:55 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43GSsfH045292; Sat, 3 May 2014 16:28:54 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405031628.s43GSsfH045292@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 3 May 2014 16:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265279 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:28:56 -0000 Author: melifaro Date: Sat May 3 16:28:54 2014 New Revision: 265279 URL: http://svnweb.freebsd.org/changeset/base/265279 Log: Pass radix head ptr along with rte to rtexpunge(). Rename rtexpunge to rt_expunge(). Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/in_rmx.c head/sys/netinet6/in6_ifattach.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 3 16:24:41 2014 (r265278) +++ head/sys/net/route.c Sat May 3 16:28:54 2014 (r265279) @@ -898,7 +898,7 @@ rt_getifa_fib(struct rt_addrinfo *info, * The route must be locked. */ int -rtexpunge(struct rtentry *rt) +rt_expunge(struct radix_node_head *rnh, struct rtentry *rt) { #if !defined(RADIX_MPATH) struct radix_node *rn; @@ -907,17 +907,10 @@ rtexpunge(struct rtentry *rt) int fib; struct rtentry *rt0; #endif - struct radix_node_head *rnh; struct ifaddr *ifa; int error = 0; - /* - * Find the correct routing tree to use for this Address Family - */ - rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); RT_LOCK_ASSERT(rt); - if (rnh == NULL) - return (EAFNOSUPPORT); RADIX_NODE_HEAD_LOCK_ASSERT(rnh); #ifdef RADIX_MPATH Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat May 3 16:24:41 2014 (r265278) +++ head/sys/net/route.h Sat May 3 16:28:54 2014 (r265279) @@ -371,7 +371,7 @@ int rtsock_routemsg(int, struct ifnet *i * RTFREE() uses an unlocked entry. */ -int rtexpunge(struct rtentry *); +int rt_expunge(struct radix_node_head *, struct rtentry *); void rtfree(struct rtentry *); int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sat May 3 16:24:41 2014 (r265278) +++ head/sys/netinet/in_rmx.c Sat May 3 16:28:54 2014 (r265279) @@ -169,9 +169,8 @@ in_clsroute(struct radix_node *rn, struc if (V_rtq_reallyold != 0) { rt->rt_flags |= RTPRF_OURS; rt->rt_expire = time_uptime + V_rtq_reallyold; - } else { - rtexpunge(rt); - } + } else + rt_expunge(head, rt); } struct rtqk_arg { @@ -388,6 +387,7 @@ in_detachhead(void **head, int off) * plug back in. */ struct in_ifadown_arg { + struct radix_node_head *rnh; struct ifaddr *ifa; int del; }; @@ -411,7 +411,7 @@ in_ifadownkill(struct radix_node *rn, vo * Disconnect it from the tree and permit protocols * to cleanup. */ - rtexpunge(rt); + rt_expunge(ap->rnh, rt); /* * At this point it is an rttrash node, and in case * the above is the only reference we must free it. Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sat May 3 16:24:41 2014 (r265278) +++ head/sys/netinet6/in6_ifattach.c Sat May 3 16:28:54 2014 (r265279) @@ -863,7 +863,7 @@ in6_ifdetach(struct ifnet *ifp) RT_DEFAULT_FIB); if (rt) { if (rt->rt_ifp == ifp) - rtexpunge(rt); + rt_expunge(rnh, rt); RTFREE_LOCKED(rt); } RADIX_NODE_HEAD_UNLOCK(rnh);