summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-20 19:44:45 +0300
committerGitHub <noreply@github.com>2021-10-20 19:44:45 +0300
commit5db95752c063a46a6ee8cdf5e65d45c68a8de77f (patch)
tree51fc37290262fc671c053bbd88406df8782a8595 /zebra/zebra_rib.c
parent16e2b641fa8d97dd315e8ff30426527bfd32bc07 (diff)
parente13f12a7d147a993a0aefd0b2b0ba947746071b4 (diff)
Merge pull request #9811 from donaldsharp/rib_update_fix
Various thread functional fixes
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 12e82dde94..fcac3328c9 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3890,14 +3890,16 @@ void rib_update(enum rib_update_event event)
{
struct rib_update_ctx *ctx;
- ctx = rib_update_ctx_init(0, event);
+ if (thread_is_scheduled(t_rib_update_threads[event]))
+ return;
+ ctx = rib_update_ctx_init(0, event);
ctx->vrf_all = true;
- if (!thread_add_event(zrouter.master, rib_update_handler, ctx, 0,
- &t_rib_update_threads[event]))
- rib_update_ctx_fini(&ctx); /* Already scheduled */
- else if (IS_ZEBRA_DEBUG_EVENT)
+ thread_add_event(zrouter.master, rib_update_handler, ctx, 0,
+ &t_rib_update_threads[event]);
+
+ if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("%s: Scheduled VRF (ALL), event %s", __func__,
rib_update_event2str(event));
}