diff options
Diffstat (limited to 'ospfd/ospf_abr.c')
| -rw-r--r-- | ospfd/ospf_abr.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c index 6a009d2144..8e59bd9ebd 100644 --- a/ospfd/ospf_abr.c +++ b/ospfd/ospf_abr.c @@ -318,10 +318,29 @@ int ospf_area_range_substitute_unset(struct ospf *ospf, struct in_addr area_id, 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 */ |
