struct zebra_vrf *zvrf;
struct listnode *ln, *nn;
struct zserv *client;
+ static bool sigint_done;
+
+ if (sigint_done)
+ return;
+
+ sigint_done = true;
zlog_notice("Terminating on signal");
frr_early_fini();
+ zebra_dplane_pre_finish();
+
for (ALL_LIST_ELEMENTS(zebrad.client_list, ln, nn, client))
zserv_close_client(client);
prefix_list_reset();
route_map_finish();
- list_delete_and_null(&zebrad.client_list);
+ list_delete(&zebrad.client_list);
+
+ /* Indicate that all new dplane work has been enqueued. When that
+ * work is complete, the dataplane will enqueue an event
+ * with the 'finalize' function.
+ */
+ zebra_dplane_finish();
+}
+
+/*
+ * Final shutdown step for the zebra main thread. This is run after all
+ * async update processing has completed.
+ */
+int zebra_finalize(struct thread *dummy)
+{
+ zlog_info("Zebra final shutdown");
+
+ /* Stop dplane thread and finish any cleanup */
+ zebra_dplane_shutdown();
+
work_queue_free_and_null(&zebrad.ribq);
meta_queue_free(zebrad.mq);
/* RNH init */
zebra_rnh_init();
-
+
/* Error init */
zebra_error_init();