An OSPF ABR, while in the process of announcing summary LSAs,
checks whether it's connected to the backbone area. If not, then
all summary LSAs are invalidated and not announced (or flushed)
while the missing backbone connectivity persists.
The backbone connectivity check consists of assessing whether
there's at least one fully formed adjacency in the backbone area. The
problem is that this check can fail unexpectedly if the router is
acting as a helper for a neighbor that is performing a graceful
restart. This is because there's a short interim of time in which
that neighbor's state will oscillate between ExStart and Full during
the LSDB synchronization process.
To address that issue, update ospf_act_bb_connection() to consider
neighbors performing a graceful restart as if they were fully
adjacent (which is what a GR helper should do).
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
int ospf_act_bb_connection(struct ospf *ospf)
{
+ struct ospf_interface *oi;
+ struct listnode *node;
+ int full_nbrs = 0;
+
if (ospf->backbone == NULL)
return 0;
- return ospf->backbone->full_nbrs;
+ for (ALL_LIST_ELEMENTS_RO(ospf->backbone->oiflist, node, oi)) {
+ struct ospf_neighbor *nbr;
+ struct route_node *rn;
+
+ for (rn = route_top(oi->nbrs); rn; rn = route_next(rn)) {
+ nbr = rn->info;
+ if (!nbr)
+ continue;
+
+ if (nbr->state == NSM_Full
+ || OSPF_GR_IS_ACTIVE_HELPER(nbr))
+ full_nbrs++;
+ }
+ }
+
+ return full_nbrs;
}
/* Determine whether this router is elected translator or not for area */