summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.c
diff options
context:
space:
mode:
authorMark Stapp <mstapp@nvidia.com>2022-02-10 13:29:59 -0500
committerMark Stapp <mstapp@nvidia.com>2022-02-11 17:03:26 -0500
commit348698095d1e1dc9904e13c86ce8492d89558a8d (patch)
treec848def37627fbd81f8304196c948fbc5d1c2dd7 /zebra/zebra_router.c
parent70d79c359b321337c3791944ef068917b24748b6 (diff)
zebra: make netlink object hash threadsafe
The recently-added hashtable of nlsock objects needs to be thread-safe: it's accessed from the main and dplane pthreads. Add a mutex for it, use wrapper apis when accessing it. Add a per-OS init/terminate api so we can do init that's not per-vrf or per-namespace. Signed-off-by: Mark Stapp <mstapp@nvidia.com>
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r--zebra/zebra_router.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index 92a3b9424b..6b4a7543cd 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -262,6 +262,9 @@ void zebra_router_terminate(void)
#ifdef HAVE_SCRIPTING
zebra_script_destroy();
#endif
+
+ /* OS-specific deinit */
+ kernel_router_terminate();
}
bool zebra_router_notify_on_ack(void)
@@ -307,4 +310,7 @@ void zebra_router_init(bool asic_offload, bool notify_on_ack)
#ifdef HAVE_SCRIPTING
zebra_script_init();
#endif
+
+ /* OS-specific init */
+ kernel_router_init();
}