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>
This commit is contained in:
Donald Sharp 2019-05-03 20:54:20 -04:00
parent 56e7825479
commit c447ad08b2
9 changed files with 9 additions and 76 deletions

View 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

View 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)

View 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;
}

View 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();

View 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

View 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

View 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);

View 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);

View 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];