Skip to content

lib,ospfd: support table-direct in OSPFv2 #19316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/route_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ZEBRA_ROUTE_NHRP, nhrp, nhrpd, 'N', 1, 1, 1, "NHRP", nh
# possible).
ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 0, 0, 0, "HSLS", hslsd
ZEBRA_ROUTE_OLSR, olsr, olsrd, 'o', 0, 0, 0, "OLSR", olsrd
ZEBRA_ROUTE_TABLE, table, zebra, 'T', 1, 1, 1, "Table", zebra
ZEBRA_ROUTE_TABLE, table, zebra, 'T', 1, 1, 0, "Table", zebra
ZEBRA_ROUTE_LDP, ldp, ldpd, 'L', 0, 0, 0, "LDP", ldpd
#vnc when sent to zebra
ZEBRA_ROUTE_VNC, vnc, NULL, 'v', 1, 1, 1, "VNC", bgpd-vnc
Expand All @@ -87,7 +87,7 @@ ZEBRA_ROUTE_OPENFABRIC, openfabric, fabricd, 'f', 1, 1, 1, "OpenFabric", fa
ZEBRA_ROUTE_VRRP, vrrp, vrrpd, '-', 0, 0, 0, "VRRP", vrrpd
ZEBRA_ROUTE_NHG, zebra, none, '-', 0, 0, 0, "Nexthop Group", none
ZEBRA_ROUTE_SRTE, srte, none, '-', 0, 0, 0, "SR-TE", none
ZEBRA_ROUTE_TABLE_DIRECT, table-direct, zebra, 't', 1, 1, 1, "Table-Direct", zebra
ZEBRA_ROUTE_TABLE_DIRECT, table-direct, zebra, 't', 1, 1, 0, "Table-Direct", zebra
ZEBRA_ROUTE_ALL, any, none, '-', 0, 0, 0, "-", none


Expand Down
11 changes: 5 additions & 6 deletions ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -9300,10 +9300,11 @@ DEFUN (no_ospf_redistribute_source,

DEFUN (ospf_redistribute_instance_source,
ospf_redistribute_instance_source_cmd,
"redistribute <ospf|table> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]",
"redistribute <ospf|table|table-direct> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]",
REDIST_STR
"Open Shortest Path First\n"
"Non-main Kernel Routing Table\n"
"Non-main Kernel Routing Table - Direct\n"
"Instance ID/Table ID\n"
"Metric for redistributed routes\n"
"OSPF default metric\n"
Expand Down Expand Up @@ -9376,11 +9377,12 @@ DEFUN (ospf_redistribute_instance_source,

DEFUN (no_ospf_redistribute_instance_source,
no_ospf_redistribute_instance_source_cmd,
"no redistribute <ospf|table> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]",
"no redistribute <ospf|table|table-direct> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]",
NO_STR
REDIST_STR
"Open Shortest Path First\n"
"Non-main Kernel Routing Table\n"
"Non-main Kernel Routing Table - Direct\n"
"Instance ID/Table Id\n"
"Metric for redistributed routes\n"
"OSPF default metric\n"
Expand All @@ -9396,10 +9398,7 @@ DEFUN (no_ospf_redistribute_instance_source,
struct ospf_redist *red;
int source;

if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0)
source = ZEBRA_ROUTE_OSPF;
else
source = ZEBRA_ROUTE_TABLE;
source = proto_redistnum(AFI_IP, argv[idx_ospf_table]->text);

instance = strtoul(argv[idx_number]->arg, NULL, 10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_step5_no_redistribute_table_2200():
pytest.skip(tgen.errors)

tgen.gears["r2"].vtysh_cmd(
"configure terminal\nrouter bgp 65501\naddress-family ipv4 unicast\nno redistribute table-direct\n"
"configure terminal\nrouter bgp 65501\naddress-family ipv4 unicast\nno redistribute table-direct 2200\n"
)

step("r2, check that the 'redistribute' command is not configured")
Expand Down
Loading