diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2023-04-01 18:13:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-01 18:13:58 -0500 |
| commit | a9094c499bd47d43b1e2e4cd6030f196db8ddbf1 (patch) | |
| tree | 2a6c43347814cdc2d6423c7f156ea1939b17d98e /zebra/zebra_rib.c | |
| parent | acdb814dfa9e9d242e66305896baf8a48dd4d447 (diff) | |
| parent | 3cd0accb5051e900ab343d5fa7c59360c0c1a812 (diff) | |
Merge pull request #13175 from donaldsharp/msdp_topo1_memleak
zebra: Cleanup ctx leak on shutdown and turn off event
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 19 |
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, |
