diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-11-20 12:46:36 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-21 12:41:18 -0500 |
| commit | 82463eb1a927bcbc398765e29f76cd4d5f0c005d (patch) | |
| tree | 27ea8bcd23ce7399937af8657fe590720d666e55 /zebra/zebra_dplane.c | |
| parent | a1c1b9d9c5065d95eec7a860e067c2c9a6ca6937 (diff) | |
zebra: On shutdown, ensure dg_update_list is emptied
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
| -rw-r--r-- | zebra/zebra_dplane.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index e1d1e84172..afe421679a 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -7360,6 +7360,7 @@ static void dplane_thread_loop(struct event *event) void zebra_dplane_shutdown(void) { struct zebra_dplane_provider *dp; + struct zebra_dplane_ctx *ctx; if (IS_ZEBRA_DEBUG_DPLANE) zlog_debug("Zebra dataplane shutdown called"); @@ -7396,6 +7397,16 @@ void zebra_dplane_shutdown(void) } /* TODO -- Clean queue(s), free memory */ + DPLANE_LOCK(); + { + ctx = dplane_ctx_list_pop(&zdplane_info.dg_update_list); + while (ctx) { + dplane_ctx_free(&ctx); + + ctx = dplane_ctx_list_pop(&zdplane_info.dg_update_list); + } + } + DPLANE_UNLOCK(); } /* |
