pimd: Fix crash with interface not configed under pim.

When the RP's address in PIM is not under the loopback,
we can have a situation where this causes PIM to crash.
Check for NULL pointers.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-08-24 08:29:24 -04:00
parent 6abb1fc25f
commit 359175704f

View File

@ -379,7 +379,7 @@ pim_upstream_could_register (struct pim_upstream *up)
{
struct pim_interface *pim_ifp = up->rpf.source_nexthop.interface->info;
if (PIM_I_am_DR (pim_ifp) &&
if (pim_ifp && PIM_I_am_DR (pim_ifp) &&
pim_if_connected_to_source (up->rpf.source_nexthop.interface, up->sg.src))
return 1;