summaryrefslogtreecommitdiff
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
parenteec50add2230f7d60d19383777145f0dffca9edc (diff)
parent990baca057d2aa62979292933cc7a86068f02575 (diff)
Merge pull request #3086 from patrasar/1836
ospfd: handling of OSPF_AREA_RANGE_ADVERTISE flag
-rw-r--r--ospf6d/ospf6_area.c1
-rw-r--r--ospfd/ospf_abr.c6
-rw-r--r--ospfd/ospf_vty.c1
3 files changed, 7 insertions, 1 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 2cab69aac2..f72ca63ff9 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -441,6 +441,7 @@ DEFUN (area_range,
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);
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 870037efc0..c8b8b611ef 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 e25d1a31de..25d54a8553 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;
}