Skip to content

Commit

Permalink
Fix dynamic sessions with multiple bgp instances
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donaldsharp committed Aug 26, 2015
1 parent 16cf945 commit 2aab8d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,7 @@ peer_group_listen_range_add (struct peer_group *group, struct prefix *range)
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. */
Expand Down Expand Up @@ -3035,9 +3035,10 @@ peer_group_lookup_dynamic_neighbor (struct bgp *bgp, struct prefix *prefix,
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;
}
Expand Down

0 comments on commit 2aab8d2

Please sign in to comment.