Ticket:CM-6534
Reviewed by:CCR-3239
Testing: See Bug
Dynamic neighbors did not work properly with multiple bgp instances.
This was caused by the lookup for the dynamic range attempting to
break out of two for loops at the same time. The break only stopped
the innermost for loop, causing it to only ever find the listen-range
for the last instance in the bm->bgp list.
Additional bug fix for dynamic listen for peer groups that are configured
with internal or external key word.
afi = family2afi(range->family);
/* Group needs remote AS configured. */
- if (! group->conf->as)
+ if (group->conf->as_type == AS_UNSPECIFIED)
return BGP_ERR_PEER_GROUP_NO_REMOTE_AS;
/* Ensure no duplicates. Currently we don't care about overlaps. */
for (ALL_LIST_ELEMENTS (bm->bgp, bgpnode, nbgpnode, bgp))
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
if ((range = peer_group_lookup_dynamic_neighbor_range(group, prefix)))
- break;
+ goto found_range;
}
+ found_range:
*listen_range = range;
return (group && range) ? group : NULL;
}