From 58c51da21261a492c792a9393b78a1790f0bb041 Mon Sep 17 00:00:00 2001 From: anuradhak Date: Wed, 23 Nov 2016 13:35:45 -0800 Subject: [PATCH] pim-nexthop: set the correct nexthop address in the rpf info. When a nexthop lookup is done we can get an ECMP output. But not all nexthops are pim neighbors. If for this reason PIM chose a nexthop other than the first the rpf info was not being set correctly i.e. nexthop ip was still the one associated with the first path but interface was set to the one associated with second path. This problem is seen on a link flap in the CLOS topology. Ticket: CM-13714 Signed-off-by: Anuradha Karuppiah Acked-by: Donald Sharp --- pimd/pim_rpf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index 48cb2e4017..24ed621a0d 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -153,20 +153,20 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei if (PIM_DEBUG_ZEBRA) { char nexthop_str[PREFIX_STRLEN]; char addr_str[INET_ADDRSTRLEN]; - pim_addr_dump("", &nexthop_tab[0].nexthop_addr, nexthop_str, sizeof(nexthop_str)); + pim_addr_dump("", &nexthop_tab[i].nexthop_addr, nexthop_str, sizeof(nexthop_str)); pim_inet4_dump("", addr, addr_str, sizeof(addr_str)); zlog_debug("%s %s: found nexthop %s for address %s: interface %s ifindex=%d metric=%d pref=%d", __FILE__, __PRETTY_FUNCTION__, nexthop_str, addr_str, ifp->name, first_ifindex, - nexthop_tab[0].route_metric, - nexthop_tab[0].protocol_distance); + nexthop_tab[i].route_metric, + nexthop_tab[i].protocol_distance); } /* update nextop data */ nexthop->interface = ifp; - nexthop->mrib_nexthop_addr = nexthop_tab[0].nexthop_addr; - nexthop->mrib_metric_preference = nexthop_tab[0].protocol_distance; - nexthop->mrib_route_metric = nexthop_tab[0].route_metric; + nexthop->mrib_nexthop_addr = nexthop_tab[i].nexthop_addr; + nexthop->mrib_metric_preference = nexthop_tab[i].protocol_distance; + nexthop->mrib_route_metric = nexthop_tab[i].route_metric; nexthop->last_lookup = addr; nexthop->last_lookup_time = pim_time_monotonic_usec(); return 0; -- 2.39.5