From: Donald Sharp Date: Tue, 13 Dec 2016 00:23:29 +0000 (-0500) Subject: pimd: Fix core when bouncing interfaces X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~16 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=28185336ed0c8219ce44454c3bd3f3495e71afd3;p=matthieu%2Ffrr.git pimd: Fix core when bouncing interfaces 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 Reviewed-by: Don Slice --- diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 3c8bbac6ec..0b5c7cc1eb 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -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; } diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index 914395e596..9c18c2482a 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -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)