diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2020-08-14 21:29:56 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2020-08-14 21:29:56 +0000 |
commit | 2f23f45b20ace184ddc5183d298a9f47cd9c2e33 (patch) | |
tree | 6560fd1222d0da4c83cd82076380d098624ed5a8 /sys/netinet6/in6_rmx.c | |
parent | ea7b737a6fe72565f53471d2a1e1b03a0348c642 (diff) | |
download | src-2f23f45b20ace184ddc5183d298a9f47cd9c2e33.tar.gz src-2f23f45b20ace184ddc5183d298a9f47cd9c2e33.zip |
Notes
Diffstat (limited to 'sys/netinet6/in6_rmx.c')
-rw-r--r-- | sys/netinet6/in6_rmx.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index f705c91602f4..c026bf4a057c 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -101,11 +101,6 @@ __FBSDID("$FreeBSD$"); #include <netinet/tcp_timer.h> #include <netinet/tcp_var.h> -extern int in6_inithead(void **head, int off, u_int fibnum); -#ifdef VIMAGE -extern int in6_detachhead(void **head, int off); -#endif - static int rib6_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *mask, struct nhop_object *nh) @@ -147,8 +142,8 @@ rib6_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *ma * Initialize our routing tree. */ -int -in6_inithead(void **head, int off, u_int fibnum) +struct rib_head * +in6_inithead(uint32_t fibnum) { struct rib_head *rh; struct rib_subscription *rs; @@ -156,29 +151,26 @@ in6_inithead(void **head, int off, u_int fibnum) rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3, AF_INET6, fibnum); if (rh == NULL) - return (0); + return (NULL); rh->rnh_preadd = rib6_preadd; #ifdef RADIX_MPATH rt_mpath_init_rnh(rh); #endif - *head = (void *)rh; - rs = rib_subscribe(fibnum, AF_INET6, nd6_subscription_cb, NULL, + rs = rib_subscribe_internal(rh, nd6_subscription_cb, NULL, RIB_NOTIFY_IMMEDIATE, true); KASSERT(rs != NULL, ("Unable to subscribe to fib %u\n", fibnum)); - return (1); + return (rh); } #ifdef VIMAGE -int -in6_detachhead(void **head, int off) +void +in6_detachhead(struct rib_head *rh) { - rt_table_destroy((struct rib_head *)(*head)); - - return (1); + rt_table_destroy(rh); } #endif |