Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 May 2014 16:28:54 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
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
Message-ID:  <201405031628.s43GSsfH045292@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405031628.s43GSsfH045292>