summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorAlexander Skorichenko <askorichenko@netgate.com>2024-02-28 20:34:06 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-18 11:45:17 +0000
commit69f07fab28b32846a95571eb7404ef870cc3784c (patch)
tree72ef4969d51f1a87c056a4528776b4e43a4654d5 /zebra
parentca2d6f0f1e000951224a18973cc1827f7f5215b5 (diff)
zebra: fix route deletion during zebra shutdown
Split zebra's vrf_terminate() into disable() and delete() stages. The former enqueues all events for the dplane thread. Memory freeing is performed in the second stage. Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com> (cherry picked from commit 444ce317b2af491b5cdc321286772627a5d4c8ea)
Diffstat (limited to 'zebra')
-rw-r--r--zebra/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 1e833ce7f1..b660118824 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -195,6 +195,12 @@ static void sigint(void)
list_delete(&zrouter.client_list);
+ /*
+ * Besides other clean-ups zebra's vrf_disable() also enqueues installed
+ * routes for removal from the kernel, unless ZEBRA_VRF_RETAIN is set.
+ */
+ vrf_iterate(vrf_disable);
+
/* Indicate that all new dplane work has been enqueued. When that
* work is complete, the dataplane will enqueue an event
* with the 'finalize' function.