]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fix dynamic sessions with multiple bgp instances
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 26 Aug 2015 16:03:30 +0000 (09:03 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 26 Aug 2015 16:03:30 +0000 (09:03 -0700)
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.

bgpd/bgpd.c

index 976e614daa7439defb2897f11f065c96db6fc7c8..abd8c03cd9eafcbbd847ba3e033e88b535b40be8 100644 (file)
@@ -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. */
@@ -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;
 }