From 38f380f56d703a75480aa4329ad5b5ccf2908edf Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 8 Dec 2016 13:50:46 -0500 Subject: [PATCH] pimd: Fix crash w/ ifp null in pim_mroute.c When you do a series of ifdown/ifup for an interface that is receiving packets through the kernel pim socket, it is possible that the interface has been deleted but the kernel is still going to deliver us a packet. In that case do not allow us to crash. Ticket: CM-13981 Signed-off-by: Donald Sharp --- pimd/pim_mroute.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index fdae0b9a22..1489c70f08 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -511,6 +511,8 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size) ifp = pim_if_find_by_vif_index(msg->im_vif); + if (!ifp) + return 0; if (PIM_DEBUG_MROUTE) { pim_inet4_dump("", msg->im_src, src_str, sizeof(src_str)); pim_inet4_dump("", msg->im_dst, grp_str, sizeof(grp_str)); -- 2.39.5