Pass radix head ptr along with rte to rtexpunge().
Rename rtexpunge to rt_expunge().
This commit is contained in:
parent
2965ace268
commit
a4407f98c0
@ -898,7 +898,7 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum)
|
||||
* 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
|
||||
|
@ -371,7 +371,7 @@ int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int);
|
||||
* 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 *);
|
||||
|
||||
|
@ -169,9 +169,8 @@ in_clsroute(struct radix_node *rn, struct radix_node_head *head)
|
||||
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, void *xap)
|
||||
* 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.
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user