Issue: # https://github.com/FRRouting/frr/issues/1836
Issue 1: if the router ospf current configuration is "area 0.0.0.2
range 1.0.0.0/24 cost 23" and user try to configure "area 0.0.0.2
range 1.0.0.0/24 not-advertise", the existing o/p is "area 0.0.0.2
range 1.0.0.0/24 cost 23 not-advertise". The keywords "not-advertise"
& "cost" are multually exclusive, so they should not come together.
The vice versa way configuration is working fine.
Fix: When ospf area range "not-advertise", the cost should be initialized
to OSPF_AREA_RANGE_COST_UNSPEC.
Issue 2: if the router ospf current configuration "area 0.0.0.2 range
1.0.0.0/24 substitute 2.0.0.0/24" and user try to configure "area 0.0.0.2
range 1.0.0.0/24 not-advertise" the existing o/p is "area 0.0.0.2 range
1.0.0.0/24 not-advertise substitute 2.0.0.0/24". The keywords
"not-advertise" & "substiture" are multually exclusive, so they should
not come together. The vice versa way configuration is working fine.
Fix: When ospf area range "not-advertise" is configured,
ospf_area_range_substitute_unset() should be get called.
Issue 3: if the router ospf6 current configuration is "area 0.0.0.2
range 2001::/64 cost 23" and user try to configure "area 0.0.0.2 range
2001::/64 advertise", the existing o/p is area 0.0.0.2 range 2001::/64.
The keyword "cost 23" disappears.
Fix: When ospf area range "advertise" is configured and the range is not
NULL, the cost should not be modified.
Signed-off-by: Sarita Patra <saritap@vmware.com>
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 {
cost = strtoul(argv[5]->arg, NULL, 10);
UNSET_FLAG(range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE);
range = ospf_area_range_lookup(area, p);
if (range != NULL) {
+ if (!CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE))
+ range->cost_config = OSPF_AREA_RANGE_COST_UNSPEC;
if ((CHECK_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE)
&& !CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE))
|| (!CHECK_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE)
if (CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE))
SET_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE);
- else
+ else {
UNSET_FLAG(range->flags, OSPF_AREA_RANGE_ADVERTISE);
+ range->cost_config = OSPF_AREA_RANGE_COST_UNSPEC;
+ }
return 1;
}
ospf_area_range_set(ospf, area_id, &p, 0);
ospf_area_display_format_set(ospf, ospf_area_get(ospf, area_id),
format);
+ ospf_area_range_substitute_unset(ospf, area_id, &p);
return CMD_SUCCESS;
}