]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/main.c
Merge pull request #5706 from mjstapp/fix_nh_debug_show
[mirror_frr.git] / zebra / main.c
index 84e83bc37e3cf712b8efb68c5ba79782915a95c7..75f825e5077e7179f22daee23e84b66e30f162a3 100644 (file)
 #include "filter.h"
 #include "memory.h"
 #include "zebra_memory.h"
-#include "memory_vty.h"
 #include "prefix.h"
 #include "log.h"
 #include "plist.h"
 #include "privs.h"
 #include "sigevent.h"
 #include "vrf.h"
-#include "logicalrouter.h"
 #include "libfrr.h"
 #include "routemap.h"
-#include "frr_pthread.h"
 
 #include "zebra/zebra_router.h"
 #include "zebra/zebra_errors.h"
@@ -86,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'},
@@ -144,6 +141,12 @@ 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();
@@ -164,6 +167,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);
@@ -227,7 +231,7 @@ 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,
 };
 
@@ -262,7 +266,6 @@ int main(int argc, char **argv)
 
        graceful_restart = 0;
        vrf_configure_backend(VRF_BACKEND_VRF_LITE);
-       logicalrouter_configure_backend(LOGICALROUTER_BACKEND_NETNS);
 
        frr_preinit(&zebra_di, argc, argv);
 
@@ -349,8 +352,6 @@ int main(int argc, char **argv)
                        break;
                case 'n':
                        vrf_configure_backend(VRF_BACKEND_NETNS);
-                       logicalrouter_configure_backend(
-                               LOGICALROUTER_BACKEND_OFF);
                        break;
                case OPTION_V6_RR_SEMANTICS:
                        v6_rr_semantics = true;
@@ -379,9 +380,6 @@ int main(int argc, char **argv)
 
        zrouter.master = frr_init();
 
-       /* Initialize pthread library */
-       frr_pthread_init();
-
        /* Zebra related initialize. */
        zebra_router_init();
        zserv_init();