From f2b2e77a4190c80d2a8b495b7b830b7ac7bef90f Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Sat, 9 Jan 2016 06:26:40 +0000 Subject: [PATCH] (Temporarily) remove route_redirect_event eventhandler. Such handler should pass different set of variables, instead of directly providing 2 locked route entries. Given that it hasn't been really used since at least 2012, remove current code. Will re-add it after finishing most major routing-related changes. Discussed with: np --- sys/net/route.c | 15 ++------------- sys/net/route.h | 2 -- sys/netinet/toecore.c | 15 --------------- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index 4df96901218e..9698dd398ac0 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -568,7 +568,7 @@ rtredirect_fib(struct sockaddr *dst, struct sockaddr *src, u_int fibnum) { - struct rtentry *rt, *rt0 = NULL; + struct rtentry *rt; int error = 0; short *stat = NULL; struct rt_addrinfo info; @@ -627,7 +627,7 @@ rtredirect_fib(struct sockaddr *dst, * Create new route, rather than smashing route to net. */ create: - rt0 = rt; + RTFREE(rt); rt = NULL; flags |= RTF_DYNAMIC; @@ -637,21 +637,14 @@ rtredirect_fib(struct sockaddr *dst, info.rti_info[RTAX_NETMASK] = netmask; info.rti_ifa = ifa; info.rti_flags = flags; - if (rt0 != NULL) - RT_UNLOCK(rt0); /* drop lock to avoid LOR with RNH */ error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); if (rt != NULL) { RT_LOCK(rt); - if (rt0 != NULL) - EVENTHANDLER_INVOKE(route_redirect_event, rt0, rt, dst); flags = rt->rt_flags; } - if (rt0 != NULL) - RTFREE(rt0); stat = &V_rtstat.rts_dynamic; } else { - struct rtentry *gwrt; /* * Smash the current notion of the gateway to @@ -669,11 +662,7 @@ rtredirect_fib(struct sockaddr *dst, RADIX_NODE_HEAD_LOCK(rnh); RT_LOCK(rt); rt_setgate(rt, rt_key(rt), gateway); - gwrt = rtalloc1(gateway, 1, RTF_RNH_LOCKED); RADIX_NODE_HEAD_UNLOCK(rnh); - EVENTHANDLER_INVOKE(route_redirect_event, rt, gwrt, dst); - if (gwrt) - RTFREE_LOCKED(gwrt); } } else error = EHOSTUNREACH; diff --git a/sys/net/route.h b/sys/net/route.h index 7c69e1c9a1c7..473e402ecdd3 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -468,8 +468,6 @@ int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, void rib_free_info(struct rt_addrinfo *info); #include -typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *); -EVENTHANDLER_DECLARE(route_redirect_event, rtevent_redirect_fn); #endif #endif diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index 6ed8eb02d260..cfa77e76a128 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -70,7 +70,6 @@ static TAILQ_HEAD(, toedev) toedev_list; static eventhandler_tag listen_start_eh; static eventhandler_tag listen_stop_eh; static eventhandler_tag lle_event_eh; -static eventhandler_tag route_redirect_eh; static int toedev_connect(struct toedev *tod __unused, struct socket *so __unused, @@ -437,17 +436,6 @@ toe_lle_event(void *arg __unused, struct llentry *lle, int evt) tod->tod_l2_update(tod, ifp, sa, lladdr, vtag); } -/* - * XXX: implement. - */ -static void -toe_route_redirect_event(void *arg __unused, struct rtentry *rt0, - struct rtentry *rt1, struct sockaddr *sa) -{ - - return; -} - /* * Returns 0 or EWOULDBLOCK on success (any other value is an error). 0 means * lladdr and vtag are valid on return, EWOULDBLOCK means the TOE driver's @@ -534,8 +522,6 @@ toecore_load(void) toe_listen_stop_event, NULL, EVENTHANDLER_PRI_ANY); lle_event_eh = EVENTHANDLER_REGISTER(lle_event, toe_lle_event, NULL, EVENTHANDLER_PRI_ANY); - route_redirect_eh = EVENTHANDLER_REGISTER(route_redirect_event, - toe_route_redirect_event, NULL, EVENTHANDLER_PRI_ANY); return (0); } @@ -553,7 +539,6 @@ toecore_unload(void) EVENTHANDLER_DEREGISTER(tcp_offload_listen_start, listen_start_eh); EVENTHANDLER_DEREGISTER(tcp_offload_listen_stop, listen_stop_eh); EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); - EVENTHANDLER_DEREGISTER(route_redirect_event, route_redirect_eh); mtx_unlock(&toedev_lock); mtx_destroy(&toedev_lock);