Skip to content
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

ospf6d: fix argument processing in the "area ... range" command (backport #9108) #9296

Merged
merged 2 commits into from
Aug 5, 2021
Merged
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
13 changes: 13 additions & 0 deletions doc/user/ospf6d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ 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.

.. _ospf6-area:

Expand Down
15 changes: 7 additions & 8 deletions ospf6d/ospf6_area.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,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);

Expand All @@ -518,16 +518,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;
Expand Down