diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-05-04 02:54:20 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-05-06 19:42:23 +0200 |
commit | c447ad08b2c880d5f3ef35af2e4055fcbc970961 (patch) | |
tree | a61e6ee854e6262c4716452b2923bbabcb270b3e | |
parent | zebra: Be consistent in how we call rib_add( and rib_delete( with tableid (diff) | |
download | frr-c447ad08b2c880d5f3ef35af2e4055fcbc970961.tar.xz frr-c447ad08b2c880d5f3ef35af2e4055fcbc970961.zip |
doc, zebra: Remove "table X" command
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>
-rw-r--r-- | doc/user/zebra.rst | 8 | ||||
-rw-r--r-- | zebra/redistribute.c | 9 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 3 | ||||
-rw-r--r-- | zebra/zebra_router.c | 1 | ||||
-rw-r--r-- | zebra/zebra_router.h | 3 | ||||
-rw-r--r-- | zebra/zebra_vrf.c | 12 | ||||
-rw-r--r-- | zebra/zebra_vty.c | 42 | ||||
-rw-r--r-- | zebra/zserv.c | 4 | ||||
-rw-r--r-- | zebra/zserv.h | 3 |
9 files changed, 9 insertions, 76 deletions
diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst index a7bf0c74d..bb3d6e491 100644 --- a/doc/user/zebra.rst +++ b/doc/user/zebra.rst @@ -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 diff --git a/zebra/redistribute.c b/zebra/redistribute.c index f98a4c02c..0071e001c 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -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) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 299491116..13d6c1a4d 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; } diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index a81752d20..63724fc35 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -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(); diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h index 72b5e9b9b..b316b91d0 100644 --- a/zebra/zebra_router.h +++ b/zebra/zebra_router.h @@ -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 diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index 2d721ec8a..315d5b490 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -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 diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 8cde07a10..77795c615 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -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); diff --git a/zebra/zserv.c b/zebra/zserv.c index e7b0a2302..fbb5af875 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -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); diff --git a/zebra/zserv.h b/zebra/zserv.h index 380f23916..d6fdc0537 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -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]; |