]> git.puffer.fish Git - mirror/frr.git/commitdiff
pim-nexthop: set the correct nexthop address in the rpf info.
authoranuradhak <anuradhak@cumulusnetworks.com>
Wed, 23 Nov 2016 21:35:45 +0000 (13:35 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:17 +0000 (20:26 -0500)
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 <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_rpf.c

index 48cb2e40178b6ab9f64a7b3b4b8898757b5d44c1..24ed621a0d04d77857b021951b114d8786267f51 100644 (file)
@@ -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?>", &nexthop_tab[0].nexthop_addr, nexthop_str, sizeof(nexthop_str));
+        pim_addr_dump("<nexthop?>", &nexthop_tab[i].nexthop_addr, nexthop_str, sizeof(nexthop_str));
         pim_inet4_dump("<addr?>", 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;