(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
This commit is contained in:
parent
16703ea811
commit
f2b2e77a41
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293466
@ -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;
|
||||
|
@ -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 <sys/eventhandler.h>
|
||||
typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *);
|
||||
EVENTHANDLER_DECLARE(route_redirect_event, rtevent_redirect_fn);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user