From 382440244ab6bfc7af09cbb677ecc5063b070bf5 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 2 Sep 2015 07:36:50 -0700 Subject: [PATCH] Multiple redistribute commands with different metric fail 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1a27b195cb..120be0a4e9 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -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); -- 2.39.5