From 82463eb1a927bcbc398765e29f76cd4d5f0c005d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 20 Nov 2023 12:46:36 -0500 Subject: [PATCH] zebra: On shutdown, ensure dg_update_list is emptied Signed-off-by: Donald Sharp --- zebra/zebra_dplane.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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(); } /* -- 2.39.5