]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix crash w/ ifp null in pim_mroute.c
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 8 Dec 2016 18:50:46 +0000 (13:50 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:19 +0000 (20:26 -0500)
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 <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c

index fdae0b9a2244d1ff633513898b0c2f2b2c1d8a46..1489c70f08f9510ca6e852ceda55115e4de5a04f 100644 (file)
@@ -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("<src?>", msg->im_src, src_str, sizeof(src_str));
       pim_inet4_dump("<grp?>", msg->im_dst, grp_str, sizeof(grp_str));