diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2021-08-18 17:59:58 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2021-08-24 00:24:41 -0300 | 
| commit | ccfffce4a06cf4cc7f50a33dbe5313edc8cf9d60 (patch) | |
| tree | 77e081d38da72646d77fb01d85d1235085520025 /ospf6d/ospf6_nssa.c | |
| parent | bb257321b21904cdb8a86f01476d8a07b8059b07 (diff) | |
ospf6d: fix flushing of all LSAs when NSSA is unconfigured
Once NSSA is unconfigured on an area, all self-originated Type-7
LSAs need to be flushed. The existing code was iterating over the
LSDB in the wrong way, causing ospf6_nssa_flush_area() to flush
LSAs of all types.  Use the ALL_LSDB_TYPED_ADVRTR macro to perform
the intended iteration correctly.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_nssa.c')
| -rw-r--r-- | ospf6d/ospf6_nssa.c | 6 | 
1 files changed, 2 insertions, 4 deletions
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c index ccba78b7c5..7782dd8774 100644 --- a/ospf6d/ospf6_nssa.c +++ b/ospf6d/ospf6_nssa.c @@ -1130,18 +1130,17 @@ static void ospf6_nssa_flush_area(struct ospf6_area *area)  	uint16_t type;  	struct ospf6_lsa *lsa = NULL, *type5 = NULL;  	struct ospf6 *ospf6 = area->ospf6; -	const struct route_node *rt = NULL;  	if (IS_OSPF6_DEBUG_NSSA)  		zlog_debug("%s: area %s", __func__, area->name);  	/* Flush the NSSA LSA */  	type = htons(OSPF6_LSTYPE_TYPE_7); -	rt = ospf6_lsdb_head(area->lsdb_self, 0, type, ospf6->router_id, &lsa); -	while (lsa) { +	for (ALL_LSDB_TYPED_ADVRTR(area->lsdb, type, ospf6->router_id, lsa)) {  		lsa->header->age = htons(OSPF_LSA_MAXAGE);  		SET_FLAG(lsa->flag, OSPF6_LSA_FLUSH);  		ospf6_flood(NULL, lsa); +  		/* Flush the translated LSA */  		if (ospf6_check_and_set_router_abr(ospf6)) {  			type = htons(OSPF6_LSTYPE_AS_EXTERNAL); @@ -1155,7 +1154,6 @@ static void ospf6_nssa_flush_area(struct ospf6_area *area)  				ospf6_flood(NULL, type5);  			}  		} -		lsa = ospf6_lsdb_next(rt, lsa);  	}  }  | 
