]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/main.c
Merge pull request #5789 from donaldsharp/bgp_ebgp_reason
[mirror_frr.git] / zebra / main.c
index 99607c0d78a72b7a4a9f5b3b928d187e42c9f326..5951c7e280758959e62a9400680c3d205430f2a2 100644 (file)
@@ -27,7 +27,6 @@
 #include "filter.h"
 #include "memory.h"
 #include "zebra_memory.h"
-#include "memory_vty.h"
 #include "prefix.h"
 #include "log.h"
 #include "plist.h"
@@ -84,7 +83,7 @@ uint32_t nl_rcvbufsize = 4194304;
 
 #define OPTION_V6_RR_SEMANTICS 2000
 /* Command line options. */
-struct option longopts[] = {
+const struct option longopts[] = {
        {"batch", no_argument, NULL, 'b'},
        {"allow_delete", no_argument, NULL, 'a'},
        {"keep_kernel", no_argument, NULL, 'k'},
@@ -142,10 +141,20 @@ static void sigint(void)
 
        zlog_notice("Terminating on signal");
 
+       atomic_store_explicit(&zrouter.in_shutdown, true,
+                             memory_order_relaxed);
+
+       /* send RA lifetime of 0 before stopping. rfc4861/6.2.5 */
+       rtadv_stop_ra_all();
+
        frr_early_fini();
 
        zebra_dplane_pre_finish();
 
+       /* Clean up GR related info. */
+       zebra_gr_stale_client_cleanup(zrouter.stale_client_list);
+       list_delete_all_node(zrouter.stale_client_list);
+
        for (ALL_LIST_ELEMENTS(zrouter.client_list, ln, nn, client))
                zserv_close_client(client);
 
@@ -162,6 +171,7 @@ 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);
@@ -225,8 +235,9 @@ struct quagga_signal_t zebra_signals[] = {
        },
 };
 
-static const struct frr_yang_module_info *zebra_yang_modules[] = {
+static const struct frr_yang_module_info *const zebra_yang_modules[] = {
        &frr_interface_info,
+       &frr_route_map_info,
 };
 
 FRR_DAEMON_INFO(