]> git.proxmox.com Git - mirror_frr.git/commitdiff
doc, zebra: Remove "table X" command
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 4 May 2019 00:54:20 +0000 (20:54 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 6 May 2019 17:42:23 +0000 (13:42 -0400)
This command is broken and has been broken since the introduction
of vrf's.  Since no-one has complained it is safe to assume that
there is no call for this specialized linux command.  Remove
from the system with extreme prejudice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
doc/user/zebra.rst
zebra/redistribute.c
zebra/zebra_rib.c
zebra/zebra_router.c
zebra/zebra_router.h
zebra/zebra_vrf.c
zebra/zebra_vty.c
zebra/zserv.c
zebra/zserv.h

index a7bf0c74da0cd6c4e91c045619c5349bc51936de..bb3d6e491c349abccd27c4dd1cd962eb55b5cd3e 100644 (file)
@@ -268,14 +268,6 @@ Link Parameters Commands
    for InterASv2 link in OSPF (RFC5392).  Note that this option is not yet
    supported for ISIS (RFC5316).
 
-.. index:: table TABLENO
-.. clicmd:: table TABLENO
-
-   Select the primary kernel routing table to be used. This only works for
-   kernels supporting multiple routing tables (like GNU/Linux 2.2.x and later).
-   After setting TABLENO with this command, static routes defined after this
-   are added to the specified table.
-
 .. index:: ip nht resolve-via-default
 .. clicmd:: ip nht resolve-via-default
 
index f98a4c02c320d8779e89cfb66199b87fdcd3efdd..0071e001c642d9fb92d8ccbe93d541931f5fef16 100644 (file)
@@ -612,7 +612,7 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
        newre->flags = re->flags;
        newre->metric = re->metric;
        newre->mtu = re->mtu;
-       newre->table = zrouter.rtm_table_default;
+       newre->table = 0;
        newre->nexthop_num = 0;
        newre->uptime = time(NULL);
        newre->instance = re->table;
@@ -632,8 +632,8 @@ int zebra_del_import_table_entry(struct route_node *rn, struct route_entry *re)
        prefix_copy(&p, &rn->p);
 
        rib_delete(afi, SAFI_UNICAST, re->vrf_id, ZEBRA_ROUTE_TABLE, re->table,
-                  re->flags, &p, NULL, re->ng.nexthop,
-                  zrouter.rtm_table_default, re->metric, re->distance, false);
+                  re->flags, &p, NULL, re->ng.nexthop, 0, re->metric,
+                  re->distance, false);
 
        return 0;
 }
@@ -647,8 +647,7 @@ int zebra_import_table(afi_t afi, uint32_t table_id, uint32_t distance,
        struct route_node *rn;
 
        if (!is_zebra_valid_kernel_table(table_id)
-           || ((table_id == RT_TABLE_MAIN)
-               || (table_id == zrouter.rtm_table_default)))
+           || (table_id == RT_TABLE_MAIN))
                return (-1);
 
        if (afi >= AFI_MAX)
index 2994911165f6bd35ced95d0946896f960006e881..13d6c1a4d55399c308e8cb9feac285ab811d0d96 100644 (file)
@@ -165,8 +165,7 @@ int is_zebra_valid_kernel_table(uint32_t table_id)
 
 int is_zebra_main_routing_table(uint32_t table_id)
 {
-       if ((table_id == RT_TABLE_MAIN)
-           || (table_id == zrouter.rtm_table_default))
+       if (table_id == RT_TABLE_MAIN)
                return 1;
        return 0;
 }
index a81752d205998e751f0e4d58367da26a0ba3b253..63724fc350dec0241fcc60c8eb7d21b5963a0deb 100644 (file)
@@ -226,7 +226,6 @@ void zebra_router_init(void)
 {
        zrouter.sequence_num = 0;
 
-       zrouter.rtm_table_default = 0;
        zrouter.packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS;
 
        zebra_vxlan_init();
index 72b5e9b9b1e0088c392268f7fe8eb301a2fed031..b316b91d0d28b337cc50fe9e6362bae719747dda 100644 (file)
@@ -89,9 +89,6 @@ struct zebra_router {
        /* A sequence number used for tracking routes */
        _Atomic uint32_t sequence_num;
 
-       /* The default table used for this router */
-       uint32_t rtm_table_default;
-
        /* rib work queue */
 #define ZEBRA_RIB_PROCESS_HOLD_TIME 10
 #define ZEBRA_RIB_PROCESS_RETRY_TIME 1
index 2d721ec8a1a53ca6e8a396e438b0184ace37ceb8..315d5b49053935e629e09f42be0bb4c2735d1af0 100644 (file)
@@ -326,15 +326,13 @@ struct route_table *zebra_vrf_table_with_table_id(afi_t afi, safi_t safi,
                return NULL;
 
        if (vrf_id == VRF_DEFAULT) {
-               if (table_id == RT_TABLE_MAIN
-                   || table_id == zrouter.rtm_table_default)
+               if (table_id == RT_TABLE_MAIN)
                        table = zebra_vrf_table(afi, safi, vrf_id);
                else
                        table = zebra_vrf_other_route_table(afi, table_id,
                                                            vrf_id);
        } else if (vrf_is_backend_netns()) {
-               if (table_id == RT_TABLE_MAIN
-                   || table_id == zrouter.rtm_table_default)
+               if (table_id == RT_TABLE_MAIN)
                        table = zebra_vrf_table(afi, safi, vrf_id);
                else
                        table = zebra_vrf_other_route_table(afi, table_id,
@@ -452,10 +450,8 @@ struct route_table *zebra_vrf_other_route_table(afi_t afi, uint32_t table_id,
        if (afi >= AFI_MAX)
                return NULL;
 
-       if ((table_id != RT_TABLE_MAIN)
-           && (table_id != zrouter.rtm_table_default)) {
-               if (zvrf->table_id == RT_TABLE_MAIN ||
-                   zvrf->table_id == zrouter.rtm_table_default) {
+       if (table_id != RT_TABLE_MAIN) {
+               if (zvrf->table_id == RT_TABLE_MAIN) {
                        /* this VRF use default table
                         * so in all cases, it does not use specific table
                         * so it is possible to configure tables in this VRF
index 8cde07a1096b109cac9e8300d23dee554fd438c1..77795c6152393b74920c80d0055d65d49a337451 100644 (file)
@@ -2556,40 +2556,6 @@ static int config_write_protocol(struct vty *vty)
        return 1;
 }
 
-#ifdef HAVE_NETLINK
-/* Display default rtm_table for all clients. */
-DEFUN (show_table,
-       show_table_cmd,
-       "show table",
-       SHOW_STR
-       "default routing table to use for all clients\n")
-{
-       vty_out(vty, "table %d\n", zrouter.rtm_table_default);
-       return CMD_SUCCESS;
-}
-
-DEFUN (config_table,
-       config_table_cmd,
-       "table TABLENO",
-       "Configure target kernel routing table\n"
-       "TABLE integer\n")
-{
-       zrouter.rtm_table_default = strtol(argv[1]->arg, (char **)0, 10);
-       return CMD_SUCCESS;
-}
-
-DEFUN (no_config_table,
-       no_config_table_cmd,
-       "no table [TABLENO]",
-       NO_STR
-       "Configure target kernel routing table\n"
-       "TABLE integer\n")
-{
-       zrouter.rtm_table_default = 0;
-       return CMD_SUCCESS;
-}
-#endif
-
 DEFUN (show_zebra,
        show_zebra_cmd,
        "show zebra",
@@ -2833,8 +2799,6 @@ DEFUN (zebra_show_routing_tables_summary,
 /* Table configuration write function. */
 static int config_write_table(struct vty *vty)
 {
-       if (zrouter.rtm_table_default)
-               vty_out(vty, "table %d\n", zrouter.rtm_table_default);
        return 0;
 }
 
@@ -2938,12 +2902,6 @@ void zebra_vty_init(void)
        install_element(CONFIG_NODE, &no_ip_forwarding_cmd);
        install_element(ENABLE_NODE, &show_zebra_cmd);
 
-#ifdef HAVE_NETLINK
-       install_element(VIEW_NODE, &show_table_cmd);
-       install_element(CONFIG_NODE, &config_table_cmd);
-       install_element(CONFIG_NODE, &no_config_table_cmd);
-#endif /* HAVE_NETLINK */
-
        install_element(VIEW_NODE, &show_ipv6_forwarding_cmd);
        install_element(CONFIG_NODE, &ipv6_forwarding_cmd);
        install_element(CONFIG_NODE, &no_ipv6_forwarding_cmd);
index e7b0a2302d3d0f1b4757a1f7fb04889ba29d3add..fbb5af875db20fd9c14db0f4e49d72bda7f4219a 100644 (file)
@@ -697,9 +697,6 @@ static struct zserv *zserv_client_create(int sock)
        pthread_mutex_init(&client->obuf_mtx, NULL);
        client->wb = buffer_new(0);
 
-       /* Set table number. */
-       client->rtm_table = zrouter.rtm_table_default;
-
        atomic_store_explicit(&client->connect_time, (uint32_t) monotime(NULL),
                              memory_order_relaxed);
 
@@ -907,7 +904,6 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client)
 
        vty_out(vty, "------------------------ \n");
        vty_out(vty, "FD: %d \n", client->sock);
-       vty_out(vty, "Route Table ID: %d \n", client->rtm_table);
 
        connect_time = (time_t) atomic_load_explicit(&client->connect_time,
                                                     memory_order_relaxed);
index 380f23916e7db80735cd0fa1e191c3e0d248f056..d6fdc0537419a7892f3916b10114f12ba4230c42 100644 (file)
@@ -83,9 +83,6 @@ struct zserv {
        /* Threads for the main pthread */
        struct thread *t_cleanup;
 
-       /* default routing table this client munges */
-       int rtm_table;
-
        /* This client's redistribute flag. */
        struct redist_proto mi_redist[AFI_MAX][ZEBRA_ROUTE_MAX];
        vrf_bitmap_t redist[AFI_MAX][ZEBRA_ROUTE_MAX];