ospf6d: fix processing of translated AS-external LSAs

The iteration performed on ospf6_abr_unapprove_translates() was
wrong since AS-external LSAs are stored in the global LSDB and not
in the area LSDBs. As such, the "unapproved" flag wasn't being set
in any translated AS-external LSA, leading them to linger forever.

Fix the LSDB iteration and make the required changes to unset the
"unapproved" flag for AS-external LSAs that shouldn't be removed.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2021-10-05 21:25:55 -03:00
parent 9e49d1aca2
commit 05da1cbfef

View File

@ -379,15 +379,12 @@ static void ospf6_abr_unapprove_translates(struct ospf6 *ospf6)
{
struct ospf6_lsa *lsa;
uint16_t type;
struct ospf6_area *oa;
struct listnode *node;
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug("ospf6_abr_unapprove_translates(): Start");
type = htons(OSPF6_LSTYPE_AS_EXTERNAL);
for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, node, oa)) {
for (ALL_LSDB_TYPED(oa->lsdb, type, lsa)) {
for (ALL_LSDB_TYPED(ospf6->lsdb, type, lsa)) {
if (CHECK_FLAG(lsa->flag, OSPF6_LSA_LOCAL_XLT)) {
SET_FLAG(lsa->flag, OSPF6_LSA_UNAPPROVED);
if (IS_OSPF6_DEBUG_NSSA)
@ -396,7 +393,6 @@ static void ospf6_abr_unapprove_translates(struct ospf6 *ospf6)
__func__, &lsa->header->id);
}
}
}
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug("ospf6_abr_unapprove_translates(): Stop");
@ -600,6 +596,7 @@ struct ospf6_lsa *ospf6_translated_nssa_refresh(struct ospf6_area *area,
__func__, &type7->header->id);
return NULL;
}
UNSET_FLAG(new->flag, OSPF6_LSA_UNAPPROVED);
}
if (IS_OSPF6_DEBUG_NSSA)
@ -692,16 +689,13 @@ int ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *lsa)
ospf6->lsdb);
}
if (old) {
/* Do not continue if type 5 LSA not approved */
if (CHECK_FLAG(old->flag, OSPF6_LSA_UNAPPROVED)) {
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug(
"%s : LSA Id %pI4 type 5 is not approved",
__func__, &old->header->id);
return 1;
if (OSPF6_LSA_IS_MAXAGE(lsa)) {
if (old)
ospf6_lsa_premature_aging(old);
return;
}
if (old) {
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug(
"%s : found old translated LSA Id %pI4, refreshing",