summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_area.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-08-19 12:14:47 -0300
committerRenato Westphal <renato@opensourcerouting.org>2021-08-24 11:53:36 -0300
commit0c293b92eeefeb37203fb0e8565c77a77fc189b0 (patch)
treefb9c93676e5e961914aa456d1031cbc9780539cf /ospf6d/ospf6_area.c
parent9142948e39f331231d05e68306c94a51db36c820 (diff)
ospf6d: do not allow an area to be stub and NSSA at the same time
That should not be allowed under any circumstance. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_area.c')
-rw-r--r--ospf6d/ospf6_area.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 0f1f061225..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);
@@ -1266,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;
}