summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-11-20 12:46:36 -0500
committerDonald Sharp <sharpd@nvidia.com>2023-11-21 12:41:18 -0500
commit82463eb1a927bcbc398765e29f76cd4d5f0c005d (patch)
tree27ea8bcd23ce7399937af8657fe590720d666e55 /zebra/zebra_dplane.c
parenta1c1b9d9c5065d95eec7a860e067c2c9a6ca6937 (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.c11
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();
}
/*