From: Christopher Dziomba Date: Mon, 28 Apr 2025 18:29:11 +0000 (+0200) Subject: zebra: free nl batch buffer on termination X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6288875e426ce854dc1d74e1844c065ac67d92ce;p=mirror%2Ffrr.git zebra: free nl batch buffer on termination The nl batch buffer was destroyed too early when a netns was terminated. Now freeing the buffer later in router_terminate allows netlink messages to be still processed. Signed-off-by: Christopher Dziomba --- diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 0c607dfa67..00dbe45ca9 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -1996,11 +1996,8 @@ void kernel_terminate(struct zebra_ns *zns, bool complete) /* During zebra shutdown, we need to leave the dataplane socket * around until all work is done. */ - if (complete) { + if (complete) kernel_nlsock_fini(&zns->netlink_dplane_out); - - XFREE(MTYPE_NL_BUF, nl_batch_tx_buf); - } } /* @@ -2020,6 +2017,8 @@ void kernel_router_init(void) */ void kernel_router_terminate(void) { + XFREE(MTYPE_NL_BUF, nl_batch_tx_buf); + pthread_mutex_destroy(&nlsock_mutex); hash_free(nlsock_hash);