]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix pim_nexthop_lookup
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 25 Oct 2016 14:40:04 +0000 (10:40 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:12 +0000 (20:26 -0500)
There are situations where we may never look at a better
route for nexthop_lookup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_rpf.c

index ffedd84103cebe213800bdd86a68b757bf1be01a..d32d65fd4c2d94f33d588c9d6d3eca914937fac5 100644 (file)
@@ -59,7 +59,7 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
     return -1;
   }
 
-  while (!found)
+  while (!found && (i < num_ifindex))
     {
       first_ifindex = nexthop_tab[i].ifindex;
 
@@ -77,16 +77,19 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
           return -2;
         }
 
-      if (!ifp->info && PIM_DEBUG_ZEBRA)
+      if (!ifp->info)
         {
-          char addr_str[INET_ADDRSTRLEN];
-          pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
-          zlog_debug("%s: multicast not enabled on input interface %s (ifindex=%d, RPF for source %s)",
-                    __PRETTY_FUNCTION__,
-                    ifp->name, first_ifindex, addr_str);
+         if (PIM_DEBUG_ZEBRA)
+           {
+             char addr_str[INET_ADDRSTRLEN];
+             pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str));
+             zlog_debug("%s: multicast not enabled on input interface %s (ifindex=%d, RPF for source %s)",
+                        __PRETTY_FUNCTION__,
+                        ifp->name, first_ifindex, addr_str);
+           }
+         i++;
         }
-
-      if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
+      else if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
         {
           struct pim_neighbor *nbr;