|
| 1 | +From cbc1602bc6be411bebce2fd9cef712622a1b1799 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Rafael Zalamena <rzalamena@opensourcerouting.org> |
| 3 | +Date: Fri, 15 Dec 2023 14:24:17 -0300 |
| 4 | +Subject: [PATCH] ospfd: support table-direct redistribution |
| 5 | + |
| 6 | +Add the 'table-direct' option to the redistribute command in OSPF. |
| 7 | + |
| 8 | +Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org> |
| 9 | +--- |
| 10 | + ospfd/ospf_vty.c | 11 +++++------ |
| 11 | + 1 file changed, 5 insertions(+), 6 deletions(-) |
| 12 | + |
| 13 | +diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c |
| 14 | +index ccc46424bc..3594ad5e2c 100644 |
| 15 | +--- a/ospfd/ospf_vty.c |
| 16 | ++++ b/ospfd/ospf_vty.c |
| 17 | +@@ -9321,10 +9321,11 @@ DEFUN (no_ospf_redistribute_source, |
| 18 | + |
| 19 | + DEFUN (ospf_redistribute_instance_source, |
| 20 | + ospf_redistribute_instance_source_cmd, |
| 21 | +- "redistribute <ospf|table> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]", |
| 22 | ++ "redistribute <ospf|table|table-direct> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]", |
| 23 | + REDIST_STR |
| 24 | + "Open Shortest Path First\n" |
| 25 | + "Non-main Kernel Routing Table\n" |
| 26 | ++ "Non-main Kernel Routing Table - Direct\n" |
| 27 | + "Instance ID/Table ID\n" |
| 28 | + "Metric for redistributed routes\n" |
| 29 | + "OSPF default metric\n" |
| 30 | +@@ -9397,11 +9398,12 @@ DEFUN (ospf_redistribute_instance_source, |
| 31 | + |
| 32 | + DEFUN (no_ospf_redistribute_instance_source, |
| 33 | + no_ospf_redistribute_instance_source_cmd, |
| 34 | +- "no redistribute <ospf|table> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]", |
| 35 | ++ "no redistribute <ospf|table|table-direct> (1-65535) [{metric (0-16777214)|metric-type (1-2)|route-map RMAP_NAME}]", |
| 36 | + NO_STR |
| 37 | + REDIST_STR |
| 38 | + "Open Shortest Path First\n" |
| 39 | + "Non-main Kernel Routing Table\n" |
| 40 | ++ "Non-main Kernel Routing Table - Direct\n" |
| 41 | + "Instance ID/Table Id\n" |
| 42 | + "Metric for redistributed routes\n" |
| 43 | + "OSPF default metric\n" |
| 44 | +@@ -9417,10 +9419,7 @@ DEFUN (no_ospf_redistribute_instance_source, |
| 45 | + struct ospf_redist *red; |
| 46 | + int source; |
| 47 | + |
| 48 | +- if (strncmp(argv[idx_ospf_table]->arg, "o", 1) == 0) |
| 49 | +- source = ZEBRA_ROUTE_OSPF; |
| 50 | +- else |
| 51 | +- source = ZEBRA_ROUTE_TABLE; |
| 52 | ++ source = proto_redistnum(AFI_IP, argv[idx_ospf_table]->text); |
| 53 | + |
| 54 | + instance = strtoul(argv[idx_number]->arg, NULL, 10); |
| 55 | + |
| 56 | +-- |
| 57 | +2.50.1 |
| 58 | + |
0 commit comments