]> git.puffer.fish Git - mirror/frr.git/commitdiff
all: remove logical-router functionality 4774/head
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 2 Aug 2019 14:10:11 +0000 (17:10 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 2 Aug 2019 14:10:11 +0000 (17:10 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 files changed:
doc/figures/nodes.dot
lib/command.c
lib/command.h
lib/logicalrouter.c [deleted file]
lib/logicalrouter.h [deleted file]
lib/netns_other.c
lib/ns.h
lib/subdir.am
tests/lib/cxxcompat.c
vtysh/extract.pl.in
vtysh/vtysh.c
vtysh/vtysh.h
vtysh/vtysh_config.c
zebra/main.c
zebra/zebra_ns.c

index d0e234958f145e732325a1bff4832bdad359b497..b548b5529a3cfbe9929c045b44f071504c9ed876 100644 (file)
@@ -55,7 +55,6 @@ digraph climodes {
        CONFIG_NODE -> KEYCHAIN_KEY_NODE [ label="key (0-2147483647)" ];
        KEYCHAIN_NODE -> KEYCHAIN_KEY_NODE [ label="key (0-2147483647)" ];
        KEYCHAIN_KEY_NODE -> KEYCHAIN_NODE [ label="no key (0-2147483647)" ];
-       CONFIG_NODE -> LOGICALROUTER_NODE [ label="logical-router (1-65535) ns NAME" ];
        CONFIG_NODE -> VRF_NODE [ label="vrf NAME" ];
        CONFIG_NODE -> INTERFACE_NODE [ label="interface IFNAME vrf NAME" ];
        INTERFACE_NODE -> LINK_PARAMS_NODE [ label="link-params" ];
index c8fbf2272105a6bbd1fbabda22e477a4171b723d..9049fb9ebc97cf38e8a460774a36315f1ca42cdc 100644 (file)
@@ -89,7 +89,6 @@ const char *node_names[] = {
        "aaa",                      // AAA_NODE,
        "keychain",                 // KEYCHAIN_NODE,
        "keychain key",             // KEYCHAIN_KEY_NODE,
-       "logical-router",          // LOGICALROUTER_NODE,
        "static ip",                // IP_NODE,
        "vrf",                      // VRF_NODE,
        "interface",                // INTERFACE_NODE,
@@ -1456,7 +1455,6 @@ void cmd_exit(struct vty *vty)
                break;
        case INTERFACE_NODE:
        case PW_NODE:
-       case LOGICALROUTER_NODE:
        case VRF_NODE:
        case NH_GROUP_NODE:
        case ZEBRA_NODE:
index 08d6128af4e2d63478cd1ba31b846550476b8ec7..8dc35a0fdc26d999cb7f91831296afad4855d3c1 100644 (file)
@@ -98,7 +98,6 @@ enum node_type {
        AAA_NODE,                /* AAA node. */
        KEYCHAIN_NODE,           /* Key-chain node. */
        KEYCHAIN_KEY_NODE,       /* Key-chain key node. */
-       LOGICALROUTER_NODE,      /* Logical-Router node. */
        IP_NODE,                 /* Static ip route node. */
        VRF_NODE,                /* VRF mode node. */
        INTERFACE_NODE,          /* Interface mode node. */
diff --git a/lib/logicalrouter.c b/lib/logicalrouter.c
deleted file mode 100644 (file)
index da69ae5..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Logical Router functions.
- * Copyright (C) 2018 6WIND S.A.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <zebra.h>
-
-#include "ns.h"
-#include "log.h"
-#include "memory.h"
-
-#include "command.h"
-#include "vty.h"
-#include "logicalrouter.h"
-
-/* Comment that useless define to avoid compilation error
- * in order to use it, one could provide the kind of NETNS to NS backend
- * so that the allocation will match the logical router
- * DEFINE_MTYPE_STATIC(LIB, LOGICALROUTER, "LogicalRouter Context")
- */
-DEFINE_MTYPE_STATIC(LIB, LOGICALROUTER_NAME, "Logical Router Name")
-
-/* Logical Router node has no interface. */
-static struct cmd_node logicalrouter_node = {LOGICALROUTER_NODE, "", 1};
-
-static int logicalrouter_backend;
-
-/* Get a NS. If not found, create one. */
-static struct ns *logicalrouter_get(ns_id_t ns_id)
-{
-       struct ns *ns;
-
-       ns = ns_lookup(ns_id);
-       if (ns)
-               return (ns);
-       ns = ns_get_created(ns, NULL, ns_id);
-       return ns;
-}
-
-static int logicalrouter_is_backend_netns(void)
-{
-       return (logicalrouter_backend == LOGICALROUTER_BACKEND_NETNS);
-}
-
-
-DEFUN_NOSH (logicalrouter,
-       logicalrouter_cmd,
-       "logical-router (1-65535) ns NAME",
-       "Enable a logical-router\n"
-       "Specify the logical-router indentifier\n"
-       "The Name Space\n"
-       "The file name in " NS_RUN_DIR ", or a full pathname\n")
-{
-       int idx_number = 1;
-       int idx_name = 3;
-       ns_id_t ns_id;
-       struct ns *ns = NULL;
-       char *pathname = ns_netns_pathname(vty, argv[idx_name]->arg);
-
-       if (!pathname)
-               return CMD_WARNING_CONFIG_FAILED;
-
-       ns_id = strtoul(argv[idx_number]->arg, NULL, 10);
-       ns = logicalrouter_get(ns_id);
-
-       if (ns->name && strcmp(ns->name, pathname) != 0) {
-               vty_out(vty, "NS %u is already configured with NETNS %s\n",
-                       ns->ns_id, ns->name);
-               return CMD_WARNING;
-       }
-
-       if (!ns->name)
-               ns->name = XSTRDUP(MTYPE_LOGICALROUTER_NAME, pathname);
-
-       if (!ns_enable(ns, NULL)) {
-               vty_out(vty, "Can not associate NS %u with NETNS %s\n",
-                       ns->ns_id, ns->name);
-               return CMD_WARNING_CONFIG_FAILED;
-       }
-
-       return CMD_SUCCESS;
-}
-
-DEFUN (no_logicalrouter,
-       no_logicalrouter_cmd,
-       "no logical-router (1-65535) ns NAME",
-       NO_STR
-       "Enable a Logical-Router\n"
-       "Specify the Logical-Router identifier\n"
-       "The Name Space\n"
-       "The file name in " NS_RUN_DIR ", or a full pathname\n")
-{
-       int idx_number = 2;
-       int idx_name = 4;
-       ns_id_t ns_id;
-       struct ns *ns = NULL;
-       char *pathname = ns_netns_pathname(vty, argv[idx_name]->arg);
-
-       if (!pathname)
-               return CMD_WARNING_CONFIG_FAILED;
-
-       ns_id = strtoul(argv[idx_number]->arg, NULL, 10);
-       ns = ns_lookup(ns_id);
-
-       if (!ns) {
-               vty_out(vty, "NS %u is not found\n", ns_id);
-               return CMD_SUCCESS;
-       }
-
-       if (ns->name && strcmp(ns->name, pathname) != 0) {
-               vty_out(vty, "Incorrect NETNS file name\n");
-               return CMD_WARNING_CONFIG_FAILED;
-       }
-
-       ns_disable(ns);
-
-       if (ns->name) {
-               XFREE(MTYPE_LOGICALROUTER_NAME, ns->name);
-               ns->name = NULL;
-       }
-
-       return CMD_SUCCESS;
-}
-
-/* Initialize NS module. */
-void logicalrouter_init(int (*writefunc)(struct vty *vty))
-{
-       if (ns_have_netns() && logicalrouter_is_backend_netns()) {
-               /* Install LogicalRouter commands. */
-               install_node(&logicalrouter_node, writefunc);
-               install_element(CONFIG_NODE, &logicalrouter_cmd);
-               install_element(CONFIG_NODE, &no_logicalrouter_cmd);
-       }
-}
-
-void logicalrouter_terminate(void)
-{
-       ns_terminate();
-}
-
-void logicalrouter_configure_backend(int backend_netns)
-{
-       logicalrouter_backend = backend_netns;
-}
diff --git a/lib/logicalrouter.h b/lib/logicalrouter.h
deleted file mode 100644 (file)
index d18832e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Logical Router related header.
- * Copyright (C) 2018 6WIND S.A.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _ZEBRA_LOGICAL_ROUTER_H
-#define _ZEBRA_LOGICAL_ROUTER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Logical Router Backend defines */
-#define LOGICALROUTER_BACKEND_OFF   0
-#define LOGICALROUTER_BACKEND_NETNS 1
-
-/*
- * Logical Router initializer/destructor
- */
-extern void logicalrouter_init(int (*writefunc)(struct vty *vty));
-extern void logicalrouter_terminate(void);
-
-/* used to configure backend for logical router
- * Currently, the whole NETNS feature is exclusively shared
- * between logical router and VRF backend NETNS
- * However, when logical router feature will be available,
- * one can think of having exclusivity only per NETNS
- */
-extern void logicalrouter_configure_backend(int backend_netns);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_ZEBRA_LOGICAL_ROUTER_H*/
index 4c7be05fab2524b393fb8e3c34cae919fa5b7afe..b0aae4f8df082dd18652478964a226738e1fa9ff 100644 (file)
@@ -82,7 +82,7 @@ const char *ns_get_name(struct ns *ns)
 }
 
 /* only called from vrf ( when removing netns from vrf)
- * or at VRF or logical router termination
+ * or at VRF termination
  */
 void ns_delete(struct ns *ns)
 {
index f3ad83788914cf16db9ca542a70e1d443d37c539..1963b8a35968750efc194319b1614d132fc66ca7 100644 (file)
--- a/lib/ns.h
+++ b/lib/ns.h
@@ -41,7 +41,7 @@ typedef uint32_t ns_id_t;
 #ifdef HAVE_NETNS
 #define NS_DEFAULT_NAME    "/proc/self/ns/net"
 #else  /* !HAVE_NETNS */
-#define NS_DEFAULT_NAME    "Default-logical-router"
+#define NS_DEFAULT_NAME    "default-netns"
 #endif /* HAVE_NETNS */
 
 struct ns {
@@ -82,10 +82,10 @@ extern struct ns_head ns_tree;
  * NS hooks
  */
 
-#define NS_NEW_HOOK        0   /* a new logical-router is just created */
-#define NS_DELETE_HOOK     1   /* a logical-router is to be deleted */
-#define NS_ENABLE_HOOK     2   /* a logical-router is ready to use */
-#define NS_DISABLE_HOOK    3   /* a logical-router is to be unusable */
+#define NS_NEW_HOOK        0   /* a new netns is just created */
+#define NS_DELETE_HOOK     1   /* a netns is to be deleted */
+#define NS_ENABLE_HOOK     2   /* a netns is ready to use */
+#define NS_DISABLE_HOOK    3   /* a netns is to be unusable */
 
 /*
  * Add a specific hook ns module.
@@ -128,7 +128,7 @@ extern void ns_walk_func(int (*func)(struct ns *));
 extern const char *ns_get_name(struct ns *ns);
 
 /* only called from vrf ( when removing netns from vrf)
- * or at VRF or logical router termination
+ * or at VRF termination
  */
 extern void ns_delete(struct ns *ns);
 
index aa89622028a881434489ee995c545af7544771c2..f4fe369a975e1249fe56156ab953280ed8a85c99 100644 (file)
@@ -95,7 +95,6 @@ lib_libfrr_la_SOURCES = \
        lib/yang_translator.c \
        lib/yang_wrappers.c \
        lib/zclient.c \
-       lib/logicalrouter.c \
        lib/printf/printf-pos.c \
        lib/printf/vfprintf.c \
        lib/printf/glue.c \
@@ -113,7 +112,6 @@ vtysh_scan += \
        $(top_srcdir)/lib/if.c \
        $(top_srcdir)/lib/if_rmap.c \
        $(top_srcdir)/lib/keychain.c \
-       $(top_srcdir)/lib/logicalrouter.c \
        $(top_srcdir)/lib/nexthop_group.c \
        $(top_srcdir)/lib/plist.c \
        $(top_srcdir)/lib/routemap.c \
@@ -241,7 +239,6 @@ pkginclude_HEADERS += \
        lib/zassert.h \
        lib/zclient.h \
        lib/zebra.h \
-       lib/logicalrouter.h \
        lib/pbr.h \
        # end
 
index 6624de7386f6dca16ef04aae0bf8eee86ec9e557..517e538abfb13eb078d4a3d3034648b9391ace44 100644 (file)
@@ -55,7 +55,6 @@
 #include "lib/libospf.h"
 #include "lib/linklist.h"
 #include "lib/log.h"
-#include "lib/logicalrouter.h"
 #include "lib/md5.h"
 #include "lib/memory.h"
 #include "lib/memory_vty.h"
index 4dc34d10efb7d39709c70e33a034fd3f5a053a70..d0b0c701a778c2ed488a0160fc96046e496c01fb 100755 (executable)
@@ -96,18 +96,12 @@ sub scan_file {
         elsif ($file =~ /lib\/if\.c$/) {
             $protocol = "VTYSH_INTERFACE";
         }
-        elsif ($file =~ /lib\/logicalrouter\.c$/) {
-            $protocol = "VTYSH_ALL";
-        }
         elsif ($file =~ /lib\/filter\.c$/) {
             $protocol = "VTYSH_ALL";
         }
        elsif ($file =~ /lib\/agentx\.c$/) {
            $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
        }
-        elsif ($file =~ /lib\/ns\.c$/) {
-            $protocol = "VTYSH_ZEBRA";
-        }
        elsif ($file =~ /lib\/nexthop_group\.c$/) {
            $protocol = "VTYSH_PBRD | VTYSH_SHARPD";
        }
index 82dbe06a9c0c2031ed13edcf5c935bb6cd3c85fc..7a1e82e6da73bee1514ce621a014259da6e8101e 100644 (file)
@@ -1188,10 +1188,6 @@ static struct cmd_node pw_node = {
        PW_NODE, "%s(config-pw)# ",
 };
 
-static struct cmd_node logicalrouter_node = {
-       LOGICALROUTER_NODE, "%s(config-logical-router)# ",
-};
-
 static struct cmd_node vrf_node = {
        VRF_NODE, "%s(config-vrf)# ",
 };
@@ -1798,7 +1794,6 @@ static int vtysh_exit(struct vty *vty)
                break;
        case INTERFACE_NODE:
        case PW_NODE:
-       case LOGICALROUTER_NODE:
        case VRF_NODE:
        case NH_GROUP_NODE:
        case ZEBRA_NODE:
@@ -2128,24 +2123,6 @@ DEFUNSH(VTYSH_ZEBRA, vtysh_pseudowire, vtysh_pseudowire_cmd,
        return CMD_SUCCESS;
 }
 
-DEFUNSH(VTYSH_ZEBRA, vtysh_logicalrouter, vtysh_logicalrouter_cmd,
-       "logical-router (1-65535) ns NAME",
-       "Enable a logical-router\n"
-       "Specify the logical-router indentifier\n"
-       "The Name Space\n"
-       "The file name in " NS_RUN_DIR ", or a full pathname\n")
-{
-       vty->node = LOGICALROUTER_NODE;
-       return CMD_SUCCESS;
-}
-
-DEFSH(VTYSH_ZEBRA, vtysh_no_logicalrouter_cmd,
-      "no logical-router (1-65535) ns NAME", NO_STR
-      "Enable a Logical-Router\n"
-      "Specify the Logical-Router identifier\n"
-      "The Name Space\n"
-      "The file name in " NS_RUN_DIR ", or a full pathname\n")
-
 DEFUNSH(VTYSH_PBRD | VTYSH_SHARPD, vtysh_nexthop_group, vtysh_nexthop_group_cmd,
        "nexthop-group NHGNAME",
        "Nexthop Group configuration\n"
@@ -2180,20 +2157,6 @@ DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_netns_cmd,
       "Detach VRF from a Namespace\n"
       "The file name in " NS_RUN_DIR ", or a full pathname\n")
 
-DEFUNSH(VTYSH_NS, vtysh_exit_logicalrouter,
-       vtysh_exit_logicalrouter_cmd, "exit",
-       "Exit current mode and down to previous mode\n")
-{
-       return vtysh_exit(vty);
-}
-
-DEFUNSH(VTYSH_NS, vtysh_quit_logicalrouter,
-       vtysh_quit_logicalrouter_cmd, "quit",
-       "Exit current mode and down to previous mode\n")
-{
-       return vtysh_exit_logicalrouter(self, vty, argc, argv);
-}
-
 DEFUNSH(VTYSH_VRF, vtysh_exit_vrf, vtysh_exit_vrf_cmd, "exit",
        "Exit current mode and down to previous mode\n")
 {
@@ -3609,7 +3572,6 @@ void vtysh_init_vty(void)
        install_node(&interface_node, NULL);
        install_node(&pw_node, NULL);
        install_node(&link_params_node, NULL);
-       install_node(&logicalrouter_node, NULL);
        install_node(&vrf_node, NULL);
        install_node(&nh_group_node, NULL);
        install_node(&rmap_node, NULL);
@@ -3819,13 +3781,6 @@ void vtysh_init_vty(void)
        install_element(PW_NODE, &vtysh_exit_interface_cmd);
        install_element(PW_NODE, &vtysh_quit_interface_cmd);
 
-       install_element(LOGICALROUTER_NODE, &vtysh_end_all_cmd);
-
-       install_element(CONFIG_NODE, &vtysh_logicalrouter_cmd);
-       install_element(CONFIG_NODE, &vtysh_no_logicalrouter_cmd);
-       install_element(LOGICALROUTER_NODE, &vtysh_exit_logicalrouter_cmd);
-       install_element(LOGICALROUTER_NODE, &vtysh_quit_logicalrouter_cmd);
-
        install_element(CONFIG_NODE, &vtysh_nexthop_group_cmd);
        install_element(NH_GROUP_NODE, &vtysh_end_all_cmd);
        install_element(NH_GROUP_NODE, &vtysh_exit_nexthop_group_cmd);
index 3b0b570a563ae5da56d897c2bf4bd2a4104d172b..b16761b41a226767ff4d7b23d17b6d6afd4d078c 100644 (file)
@@ -54,7 +54,6 @@ DECLARE_MGROUP(MVTYSH)
 #define VTYSH_ALL        VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD|VTYSH_BABELD|VTYSH_SHARPD|VTYSH_PBRD|VTYSH_STATICD|VTYSH_BFDD|VTYSH_FABRICD|VTYSH_VRRPD
 #define VTYSH_RMAP       VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_EIGRPD|VTYSH_SHARPD|VTYSH_FABRICD
 #define VTYSH_INTERFACE          VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD|VTYSH_BABELD|VTYSH_PBRD|VTYSH_FABRICD|VTYSH_VRRPD
-#define VTYSH_NS          VTYSH_ZEBRA
 #define VTYSH_VRF        VTYSH_ZEBRA|VTYSH_PIMD|VTYSH_STATICD
 #define VTYSH_KEYS        VTYSH_RIPD|VTYSH_EIGRPD
 
index 1e45e6f972ef9d01e445e38a3b92025a63a3eb98..e357a602960748a32d25976b2d02f82ba9afd2c3 100644 (file)
@@ -263,7 +263,6 @@ void vtysh_config_parse_line(void *arg, const char *line)
                                config_add_line(config->line, line);
                        } else if (config->index == RMAP_NODE
                                   || config->index == INTERFACE_NODE
-                                  || config->index == LOGICALROUTER_NODE
                                   || config->index == VTY_NODE
                                   || config->index == VRF_NODE
                                   || config->index == NH_GROUP_NODE)
@@ -278,8 +277,6 @@ void vtysh_config_parse_line(void *arg, const char *line)
                        config = config_get(INTERFACE_NODE, line);
                else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
                        config = config_get(PW_NODE, line);
-               else if (strncmp(line, "logical-router", strlen("logical-router")) == 0)
-                       config = config_get(LOGICALROUTER_NODE, line);
                else if (strncmp(line, "vrf", strlen("vrf")) == 0)
                        config = config_get(VRF_NODE, line);
                else if (strncmp(line, "nexthop-group", strlen("nexthop-group"))
index 84e83bc37e3cf712b8efb68c5ba79782915a95c7..657d1247e94638015ee97a26e9bb69f2876a52a5 100644 (file)
@@ -34,7 +34,6 @@
 #include "privs.h"
 #include "sigevent.h"
 #include "vrf.h"
-#include "logicalrouter.h"
 #include "libfrr.h"
 #include "routemap.h"
 #include "frr_pthread.h"
@@ -262,7 +261,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 +347,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;
index db4f9d0015c0df099394ff766af38119233043d9..94918365a330e4e50c20344b0b79e2e5d1304d96 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "lib/ns.h"
 #include "lib/vrf.h"
-#include "lib/logicalrouter.h"
 #include "lib/prefix.h"
 #include "lib/memory.h"
 
@@ -45,7 +44,6 @@ DEFINE_MTYPE(ZEBRA, ZEBRA_NS, "Zebra Name Space")
 
 static struct zebra_ns *dzns;
 
-static int logicalrouter_config_write(struct vty *vty);
 static int zebra_ns_disable_internal(struct zebra_ns *zns, bool complete);
 
 struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id)
@@ -188,8 +186,6 @@ int zebra_ns_init(const char *optional_default_name)
        ns_id_external = ns_map_nsid_with_external(ns_id, true);
        ns_init_management(ns_id_external, ns_id);
 
-       logicalrouter_init(logicalrouter_config_write);
-
        /* Do any needed per-NS data structure allocation. */
        dzns->if_table = route_table_init();
 
@@ -215,21 +211,6 @@ int zebra_ns_init(const char *optional_default_name)
        return 0;
 }
 
-static int logicalrouter_config_write(struct vty *vty)
-{
-       struct ns *ns;
-       int write = 0;
-
-       RB_FOREACH (ns, ns_head, &ns_tree) {
-               if (ns->ns_id == NS_DEFAULT || ns->name == NULL)
-                       continue;
-               vty_out(vty, "logical-router %u netns %s\n", ns->ns_id,
-                       ns->name);
-               write = 1;
-       }
-       return write;
-}
-
 int zebra_ns_config_write(struct vty *vty, struct ns *ns)
 {
        if (ns && ns->name != NULL)