aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_rmx.c
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2020-07-12 11:24:23 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2020-07-12 11:24:23 +0000
commit4c7ba83f9db2f890811fe40838587a4d144df495 (patch)
treedf8886cad41e9d4d2772fb7f3d2954732cad055b /sys/netinet6/in6_rmx.c
parentedc37a66e34396fb480bab54650436095b9ac678 (diff)
downloadsrc-4c7ba83f9db2f890811fe40838587a4d144df495.tar.gz
src-4c7ba83f9db2f890811fe40838587a4d144df495.zip
Switch inet6 default route subscription to the new rib subscription api.
Old subscription model allowed only single customer. Switch inet6 to the new subscription api and eliminate the old model. Differential Revision: https://reviews.freebsd.org/D25615
Notes
Notes: svn path=/head/; revision=363128
Diffstat (limited to 'sys/netinet6/in6_rmx.c')
-rw-r--r--sys/netinet6/in6_rmx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c
index 54cf0dcb23c2..5600feee8e6a 100644
--- a/sys/netinet6/in6_rmx.c
+++ b/sys/netinet6/in6_rmx.c
@@ -150,6 +150,7 @@ rib6_preadd(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *ma
int
in6_inithead(void **head, int off, u_int fibnum)
{
+ struct epoch_tracker et;
struct rib_head *rh;
rh = rt_table_init(offsetof(struct sockaddr_in6, sin6_addr) << 3,
@@ -163,6 +164,13 @@ in6_inithead(void **head, int off, u_int fibnum)
#endif
*head = (void *)rh;
+ NET_EPOCH_ENTER(et);
+ if (rib_subscribe(fibnum, AF_INET6, nd6_subscription_cb, NULL,
+ RIB_NOTIFY_IMMEDIATE, M_NOWAIT) == NULL)
+ log(LOG_ERR, "in6_inithead(): unable to subscribe to fib %u\n",
+ fibnum);
+ NET_EPOCH_EXIT(et);
+
return (1);
}