]> git.puffer.fish Git - mirror/frr.git/commitdiff
Multiple redistribute commands with different metric fail
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 2 Sep 2015 14:36:50 +0000 (07:36 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 2 Sep 2015 14:36:50 +0000 (07:36 -0700)
Ticket: CM-7339
Reviewed-by: CCR-3446
Testing: Test Suite passes now

The bgp_redistribute_metric_set function was not
taking into account the table # for deciding
what metric to set.

bgpd/bgp_zebra.c

index 1a27b195cbd87c92e9d274537d9a9c0a18d16ad1..120be0a4e9b2f990251d8c8c3d4b4fd34eeedda8 100644 (file)
@@ -1621,7 +1621,8 @@ bgp_redistribute_metric_set (struct bgp *bgp, struct bgp_redist *red, afi_t afi,
 
   for (rn = bgp_table_top(bgp->rib[afi][SAFI_UNICAST]); rn; rn = bgp_route_next(rn)) {
     for (ri = rn->info; ri; ri = ri->next) {
-      if (ri->sub_type == BGP_ROUTE_REDISTRIBUTE && ri->type == type) {
+      if (ri->sub_type == BGP_ROUTE_REDISTRIBUTE && ri->type == type &&
+         ri->instance == red->instance) {
          ri->attr->med = red->redist_metric;
          bgp_info_set_flag(rn, ri, BGP_INFO_ATTR_CHANGED);
          bgp_process(bgp, rn, afi, SAFI_UNICAST);