]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: On shutdown, ensure dg_update_list is emptied
authorDonald Sharp <sharpd@nvidia.com>
Mon, 20 Nov 2023 17:46:36 +0000 (12:46 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 21 Nov 2023 17:41:18 +0000 (12:41 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_dplane.c

index e1d1e84172aea2d9b04e23164ba995eecc05ffcb..afe421679a140cc3f42c2ddff0ae606d8f5f2e44 100644 (file)
@@ -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();
 }
 
 /*