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 7a9d0c0ed6..ceb0640553 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -4410,6 +4410,22 @@ static void rib_update_handler(struct event *thread)
*/
static struct event *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 (event_is_scheduled(t_rib_update_threads[i])) {
+ struct rib_update_ctx *ctx;
+
+ ctx = EVENT_ARG(t_rib_update_threads[i]);
+
+ rib_update_ctx_fini(&ctx);
+ EVENT_OFF(t_rib_update_threads[i]);
+ }
+ }
+}
+
/* Schedule a RIB update event for all vrfs */
void rib_update(enum rib_update_event event)
{
@@ -4418,6 +4434,9 @@ void rib_update(enum rib_update_event event)
if (event_is_scheduled(t_rib_update_threads[event]))
return;
+ if (zebra_router_in_shutdown())
+ return;
+
ctx = rib_update_ctx_init(0, event);
event_add_event(zrouter.master, rib_update_handler, ctx, 0,