That should not be allowed under any circumstance.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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);
}
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);
return CMD_WARNING_CONFIG_FAILED;
}
+ ospf6_area_no_summary_unset(ospf6, area);
+
return CMD_SUCCESS;
}
extern struct ospf6_area *ospf6_area_lookup(uint32_t, struct ospf6 *);
extern struct ospf6_area *ospf6_area_lookup_by_area_id(uint32_t area_id);
+extern void ospf6_area_stub_unset(struct ospf6 *ospf6, struct ospf6_area *area);
extern void ospf6_area_enable(struct ospf6_area *);
extern void ospf6_area_disable(struct ospf6_area *);
}
-static void ospf6_area_nssa_update(struct ospf6_area *area)
+void ospf6_area_nssa_update(struct ospf6_area *area)
{
if (IS_AREA_NSSA(area)) {
OSPF6_OPT_CLEAR(area->options, OSPF6_OPT_E);
{
if (!IS_AREA_NSSA(area)) {
+ /* Disable stub first. */
+ ospf6_area_stub_unset(ospf6, area);
+
SET_FLAG(area->flag, OSPF6_AREA_NSSA);
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug("area %s nssa set", area->name);
extern void ospf6_asbr_nssa_redist_task(struct ospf6 *ospf6);
extern void ospf6_schedule_abr_task(struct ospf6 *ospf6);
+extern void ospf6_area_nssa_update(struct ospf6_area *area);
void ospf6_asbr_prefix_readvertise(struct ospf6 *ospf6);
extern void ospf6_nssa_lsa_originate(struct ospf6_route *route,
struct ospf6_area *area);