summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-08-04 03:15:12 +0200
committerGitHub <noreply@github.com>2021-08-04 03:15:12 +0200
commit3e18e550ed4ff1a898d6e6fc186ae42771cb2000 (patch)
treea3f5c4bf8f10de969fdaf8a80fccb14e47a872a6
parentMerge pull request #9264 from ak503/nhrp_fix (diff)
parentdoc: document ospf6d's "area ... range" command (diff)
downloadfrr-3e18e550ed4ff1a898d6e6fc186ae42771cb2000.tar.xz
frr-3e18e550ed4ff1a898d6e6fc186ae42771cb2000.zip
Merge pull request #9108 from opensourcerouting/ospf6d-range-fixes
ospf6d: fix argument processing in the "area ... range" command
-rw-r--r--doc/user/ospf6d.rst14
-rw-r--r--ospf6d/ospf6_area.c15
2 files changed, 21 insertions, 8 deletions
diff --git a/doc/user/ospf6d.rst b/doc/user/ospf6d.rst
index f8595ef3f..948527d77 100644
--- a/doc/user/ospf6d.rst
+++ b/doc/user/ospf6d.rst
@@ -70,6 +70,20 @@ OSPF6 router
Use this command to control the maximum number of parallel routes that
OSPFv3 can support. The default is 64.
+.. clicmd:: area A.B.C.D range X:X::X:X/M [<advertise|not-advertise|cost (0-16777215)>]
+
+.. clicmd:: area (0-4294967295) range X:X::X:X/M [<advertise|not-advertise|cost (0-16777215)>]
+
+ Summarize a group of internal subnets into a single Inter-Area-Prefix LSA.
+ This command can only be used at the area boundary (ABR router).
+
+ By default, the metric of the summary route is calculated as the highest
+ metric among the summarized routes. The `cost` option, however, can be used
+ to set an explicit metric.
+
+ The `not-advertise` option, when present, prevents the summary route from
+ being advertised, effectively filtering the summarized routes.
+
.. clicmd:: write-multiplier (1-100)
Use this command to tune the amount of work done in the packet read and
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index f4d9964a5..0f1f06122 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -504,7 +504,7 @@ DEFUN (area_range,
struct ospf6_area *oa;
struct prefix prefix;
struct ospf6_route *range;
- uint32_t cost = OSPF_AREA_RANGE_COST_UNSPEC;
+ uint32_t cost;
VTY_DECLVAR_CONTEXT(ospf6, ospf6);
@@ -526,16 +526,15 @@ DEFUN (area_range,
range->path.cost = OSPF_AREA_RANGE_COST_UNSPEC;
}
+ /* default settings */
+ cost = OSPF_AREA_RANGE_COST_UNSPEC;
+ UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
+
if (argc > idx_type) {
- if (strmatch(argv[idx_type]->text, "not-advertise")) {
+ if (strmatch(argv[idx_type]->text, "not-advertise"))
SET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
- } else if (strmatch(argv[idx_type]->text, "advertise")) {
- UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
- cost = range->path.u.cost_config;
- } else {
+ else if (strmatch(argv[idx_type]->text, "cost"))
cost = strtoul(argv[5]->arg, NULL, 10);
- UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
- }
}
range->path.u.cost_config = cost;