summaryrefslogtreecommitdiff
path: root/zebra/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/zebra/main.c b/zebra/main.c
index c40a03551d..81a3066445 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -8,7 +8,7 @@
#include <lib/version.h>
#include "getopt.h"
#include "command.h"
-#include "thread.h"
+#include "frrevent.h"
#include "filter.h"
#include "memory.h"
#include "prefix.h"
@@ -52,7 +52,7 @@
pid_t pid;
/* Pacify zclient.o in libfrr, which expects this variable. */
-struct thread_master *master;
+struct event_loop *master;
/* Route retain mode flag. */
int retain_mode = 0;
@@ -175,11 +175,6 @@ static void sigint(void)
if (zrouter.lsp_process_q)
work_queue_free_and_null(&zrouter.lsp_process_q);
- vrf_terminate();
-
- ns_walk_func(zebra_ns_early_shutdown, NULL, NULL);
- zebra_ns_notify_close();
-
access_list_reset();
prefix_list_reset();
/*
@@ -190,6 +185,8 @@ static void sigint(void)
*/
zebra_routemap_finish();
+ rib_update_finish();
+
list_delete(&zrouter.client_list);
/* Indicate that all new dplane work has been enqueued. When that
@@ -203,10 +200,15 @@ static void sigint(void)
* Final shutdown step for the zebra main thread. This is run after all
* async update processing has completed.
*/
-void zebra_finalize(struct thread *dummy)
+void zebra_finalize(struct event *dummy)
{
zlog_info("Zebra final shutdown");
+ vrf_terminate();
+
+ ns_walk_func(zebra_ns_early_shutdown, NULL, NULL);
+ zebra_ns_notify_close();
+
/* Stop dplane thread and finish any cleanup */
zebra_dplane_shutdown();
@@ -435,8 +437,8 @@ int main(int argc, char **argv)
* we have to have route_read() called before.
*/
zrouter.startup_time = monotime(NULL);
- thread_add_timer(zrouter.master, rib_sweep_route, NULL,
- graceful_restart, &zrouter.sweeper);
+ event_add_timer(zrouter.master, rib_sweep_route, NULL, graceful_restart,
+ &zrouter.sweeper);
/* Needed for BSD routing socket. */
pid = getpid();