]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix core when bouncing interfaces
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 13 Dec 2016 00:23:29 +0000 (19:23 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:19 +0000 (20:26 -0500)
When you bounce interfaces and the system is under heavy
load there exists situations where zebra may or may not
have told us the new ifindex, but we've requested a
nexthop lookup, which bypasses normal mechanisms for
zebra communication, we may get back a ifindex that
we may have not created a ifp for yet.

Ticket: CM-14052
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
pimd/pim_iface.c
pimd/pim_rpf.c

index 3c8bbac6ecb80cc66d79e5efa3aa0562fdae78a5..0b5c7cc1eb5dffa237a4d340cd697f8abd5a74aa 100644 (file)
@@ -1044,9 +1044,9 @@ int pim_if_find_vifindex_by_ifindex(ifindex_t ifindex)
   struct interface *ifp;
 
   ifp = if_lookup_by_index_vrf (ifindex, VRF_DEFAULT);
-  pim_ifp = ifp->info;
-  if (!pim_ifp)
+  if (!ifp || !ifp->info)
     return -1;
+  pim_ifp = ifp->info;
 
   return pim_ifp->mroute_vif_index;
 }
index 914395e596cf372a9de69c58311c053749a9f47c..9c18c2482ac50a15f5f7a0dee40d3df221a009b1 100644 (file)
@@ -117,7 +117,8 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
                          __FILE__, __PRETTY_FUNCTION__,
                          first_ifindex, addr_str);
             }
-          return -2;
+         i++;
+         continue;
         }
 
       if (!ifp->info)