summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_area.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_area.c')
-rw-r--r--ospf6d/ospf6_area.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 355b8441bd..098132b1f6 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -189,6 +189,9 @@ static void ospf6_area_stub_update(struct ospf6_area *area)
static int ospf6_area_stub_set(struct ospf6 *ospf6, struct ospf6_area *area)
{
if (!IS_AREA_STUB(area)) {
+ /* Disable NSSA first. */
+ ospf6_area_nssa_unset(ospf6, area);
+
SET_FLAG(area->flag, OSPF6_AREA_STUB);
ospf6_area_stub_update(area);
}
@@ -196,7 +199,7 @@ static int ospf6_area_stub_set(struct ospf6 *ospf6, struct ospf6_area *area)
return 1;
}
-static void ospf6_area_stub_unset(struct ospf6 *ospf6, struct ospf6_area *area)
+void ospf6_area_stub_unset(struct ospf6 *ospf6, struct ospf6_area *area)
{
if (IS_AREA_STUB(area)) {
UNSET_FLAG(area->flag, OSPF6_AREA_STUB);
@@ -504,7 +507,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);
@@ -519,23 +522,22 @@ DEFUN (area_range,
range = ospf6_route_lookup(&prefix, oa->range_table);
if (range == NULL) {
- range = ospf6_route_create();
+ range = ospf6_route_create(ospf6);
range->type = OSPF6_DEST_TYPE_RANGE;
range->prefix = prefix;
range->path.area_id = oa->area_id;
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;
@@ -1267,6 +1269,8 @@ DEFUN(ospf6_area_nssa, ospf6_area_nssa_cmd,
return CMD_WARNING_CONFIG_FAILED;
}
+ ospf6_area_no_summary_unset(ospf6, area);
+
return CMD_SUCCESS;
}