svn commit: r360889 - in head/sys/net: . route
Alexander V. Chernikov
melifaro at FreeBSD.org
Mon May 11 06:09:19 UTC 2020
Author: melifaro
Date: Mon May 11 06:09:18 2020
New Revision: 360889
URL: https://svnweb.freebsd.org/changeset/base/360889
Log:
Remove unused rnh_close callback from rtable & cleanup depends.
rnh_close callbackes was used by the in[6]_clsroute() handlers,
doing cleanup in the route cloning code. Route cloning was eliminated
somewhere around r186119. Last callback user was eliminated in r186215,
11 years ago.
Differential Revision: https://reviews.freebsd.org/D24793
Modified:
head/sys/net/route.c
head/sys/net/route/route_var.h
Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c Mon May 11 05:53:12 2020 (r360888)
+++ head/sys/net/route.c Mon May 11 06:09:18 2020 (r360889)
@@ -426,11 +426,8 @@ sys_setfib(struct thread *td, struct setfib_args *uap)
void
rtfree(struct rtentry *rt)
{
- struct rib_head *rnh;
KASSERT(rt != NULL,("%s: NULL rt", __func__));
- rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family);
- KASSERT(rnh != NULL,("%s: NULL rnh", __func__));
RT_LOCK_ASSERT(rt);
@@ -445,18 +442,6 @@ rtfree(struct rtentry *rt)
}
/*
- * On last reference give the "close method" a chance
- * to cleanup private state. This also permits (for
- * IPv4 and IPv6) a chance to decide if the routing table
- * entry should be purged immediately or at a later time.
- * When an immediate purge is to happen the close routine
- * typically calls rtexpunge which clears the RTF_UP flag
- * on the entry so that the code below reclaims the storage.
- */
- if (rt->rt_refcnt == 0 && rnh->rnh_close)
- rnh->rnh_close((struct radix_node *)rt, &rnh->head);
-
- /*
* If we are no longer "up" (and ref == 0)
* then we can free the resources associated
* with the route.
@@ -1501,7 +1486,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in
return (ENOBUFS);
}
rt->rt_flags = RTF_UP | flags;
- rt->rt_fibnum = rnh->rib_fibnum;
rt->rt_nhop = nh;
/* Fill in dst */
Modified: head/sys/net/route/route_var.h
==============================================================================
--- head/sys/net/route/route_var.h Mon May 11 05:53:12 2020 (r360888)
+++ head/sys/net/route/route_var.h Mon May 11 06:09:18 2020 (r360889)
@@ -50,7 +50,6 @@ struct rib_head {
rn_lookup_f_t *rnh_lookup; /* exact match for sockaddr */
rn_walktree_t *rnh_walktree; /* traverse tree */
rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */
- rn_close_t *rnh_close; /*do something when the last ref drops*/
rnh_preadd_entry_f_t *rnh_preadd; /* hook to alter record prior to insertion */
rt_gen_t rnh_gen; /* generation counter */
int rnh_multipath; /* multipath capable ? */
@@ -144,7 +143,6 @@ struct rtentry {
int rt_flags; /* up/down?, host/net */
int rt_refcnt; /* # held references */
- u_int rt_fibnum; /* which FIB */
u_long rt_weight; /* absolute weight */
u_long rt_expire; /* lifetime for route, e.g. redirect */
#define rt_endzero rt_mtx
More information about the svn-src-head
mailing list