summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index adc6a904f1..08391f1a3d 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -4365,6 +4365,22 @@ static void rib_update_handler(struct thread *thread)
*/
static struct thread *t_rib_update_threads[RIB_UPDATE_MAX];
+void rib_update_finish(void)
+{
+ int i;
+
+ for (i = RIB_UPDATE_KERNEL; i < RIB_UPDATE_MAX; i++) {
+ if (thread_is_scheduled(t_rib_update_threads[i])) {
+ struct rib_update_ctx *ctx;
+
+ ctx = THREAD_ARG(t_rib_update_threads[i]);
+
+ rib_update_ctx_fini(&ctx);
+ THREAD_OFF(t_rib_update_threads[i]);
+ }
+ }
+}
+
/* Schedule a RIB update event for all vrfs */
void rib_update(enum rib_update_event event)
{
@@ -4373,6 +4389,9 @@ void rib_update(enum rib_update_event event)
if (thread_is_scheduled(t_rib_update_threads[event]))
return;
+ if (zebra_router_in_shutdown())
+ return;
+
ctx = rib_update_ctx_init(0, event);
ctx->vrf_all = true;