summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2018-10-01 15:26:40 +0200
committerGitHub <noreply@github.com>2018-10-01 15:26:40 +0200
commit2268d8cfe787fd09247768795c20e9ce9eccd402 (patch)
tree27bae544f70ae787060f6844c24b1627c9d04136 /ospfd
parentMerge pull request #3111 from pacovn/Coverity_1302499_Logically_dead_code (diff)
parentospfd: handling of OSPF_AREA_RANGE_ADVERTISE flag (diff)
downloadfrr-2268d8cfe787fd09247768795c20e9ce9eccd402.tar.xz
frr-2268d8cfe787fd09247768795c20e9ce9eccd402.zip
Merge pull request #3086 from patrasar/1836
ospfd: handling of OSPF_AREA_RANGE_ADVERTISE flag
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_abr.c6
-rw-r--r--ospfd/ospf_vty.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 870037efc..c8b8b611e 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -196,6 +196,8 @@ int ospf_area_range_set(struct ospf *ospf, struct in_addr area_id,
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)
@@ -209,8 +211,10 @@ int ospf_area_range_set(struct ospf *ospf, struct in_addr area_id,
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;
}
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index e25d1a31d..25d54a855 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -750,6 +750,7 @@ DEFUN (ospf_area_range_not_advertise,
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;
}