]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: free nl batch buffer on termination 18309/head
authorChristopher Dziomba <christopher.dziomba@telekom.de>
Mon, 28 Apr 2025 18:29:11 +0000 (20:29 +0200)
committerChristopher Dziomba <christopher.dziomba@telekom.de>
Mon, 28 Apr 2025 18:29:11 +0000 (20:29 +0200)
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 <christopher.dziomba@telekom.de>
zebra/kernel_netlink.c

index 0c607dfa67cb07bf59460b10816d27724986861f..00dbe45ca952540881811dd726820a78e581cc23 100644 (file)
@@ -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);