]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/main.c
lib: table.h needs to include prefix.h
[mirror_frr.git] / zebra / main.c
index 73e5f1290d9bfcc49415b778fc4d74e56ee08323..c8d7f83fb75023a3bdec34bffb1233ae6d29a157 100644 (file)
@@ -34,6 +34,7 @@
 #include "privs.h"
 #include "sigevent.h"
 #include "vrf.h"
+#include "logicalrouter.h"
 #include "libfrr.h"
 
 #include "zebra/rib.h"
@@ -47,6 +48,7 @@
 #include "zebra/redistribute.h"
 #include "zebra/zebra_mpls.h"
 #include "zebra/label_manager.h"
+#include "zebra/zebra_netns_notify.h"
 
 #define ZEBRA_PTM_SUPPORT
 
@@ -73,7 +75,7 @@ int keep_kernel_mode = 0;
 
 #ifdef HAVE_NETLINK
 /* Receive buffer size for netlink socket */
-u_int32_t nl_rcvbufsize = 4194304;
+uint32_t nl_rcvbufsize = 4194304;
 #endif /* HAVE_NETLINK */
 
 /* Command line options. */
@@ -137,18 +139,19 @@ static void sigint(void)
                        if (zvrf)
                                SET_FLAG(zvrf->flags, ZEBRA_VRF_RETAIN);
                }
+       if (zebrad.lsp_process_q)
+               work_queue_free_and_null(&zebrad.lsp_process_q);
        vrf_terminate();
 
        ns_walk_func(zebra_ns_disabled);
+       zebra_ns_notify_close();
 
        access_list_reset();
        prefix_list_reset();
        route_map_finish();
 
        list_delete_and_null(&zebrad.client_list);
-       work_queue_free(zebrad.ribq);
-       if (zebrad.lsp_process_q)
-               work_queue_free(zebrad.lsp_process_q);
+       work_queue_free_and_null(&zebrad.ribq);
        meta_queue_free(zebrad.mq);
 
        frr_fini();
@@ -205,6 +208,7 @@ int main(int argc, char **argv)
 #endif
 
        vrf_configure_backend(VRF_BACKEND_VRF_LITE);
+       logicalrouter_configure_backend(LOGICALROUTER_BACKEND_NETNS);
 
        frr_preinit(&zebra_di, argc, argv);
 
@@ -283,6 +287,8 @@ int main(int argc, char **argv)
                        break;
                case 'n':
                        vrf_configure_backend(VRF_BACKEND_NETNS);
+                       logicalrouter_configure_backend(
+                               LOGICALROUTER_BACKEND_OFF);
                        break;
 #endif /* HAVE_NETLINK */
 #if defined(HANDLE_ZAPI_FUZZING)
@@ -326,8 +332,8 @@ int main(int argc, char **argv)
        zebra_mpls_vty_init();
        zebra_pw_vty_init();
 
-       /* For debug purpose. */
-       /* SET_FLAG (zebra_debug_event, ZEBRA_DEBUG_EVENT); */
+/* For debug purpose. */
+/* SET_FLAG (zebra_debug_event, ZEBRA_DEBUG_EVENT); */
 
 #if defined(HANDLE_ZAPI_FUZZING)
        if (fuzzing) {
@@ -345,9 +351,6 @@ int main(int argc, char **argv)
        */
        frr_config_fork();
 
-       /* Clean up rib -- before fork (?) */
-       /* rib_weed_tables (); */
-
        /* After we have successfully acquired the pidfile, we can be sure
        *  about being the only copy of zebra process, which is submitting
        *  changes to the FIB.