From: Donald Sharp Date: Thu, 27 Oct 2016 22:09:09 +0000 (-0400) Subject: pimd: Fix crash when cannot find igmp X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~162 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=02e5bd7294fdcd328fbd24087cf40e6e029d40a3;p=mirror%2Ffrr.git pimd: Fix crash when cannot find igmp When we look up a igmp data structure, if we don't find it, safely do nothing. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 7935f7290e..8ece65d317 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -444,15 +444,15 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size) ifaddr = pim_find_primary_addr(ifp); igmp = pim_igmp_sock_lookup_ifaddr(pim_ifp->igmp_socket_list, ifaddr); - if (PIM_DEBUG_MROUTE_DETAIL) { + if (PIM_DEBUG_MROUTE) { pim_inet4_dump("", ip_hdr->ip_src, ip_src_str, sizeof(ip_src_str)); pim_inet4_dump("", ip_hdr->ip_dst, ip_dst_str, sizeof(ip_dst_str)); - zlog_warn("%s: igmp kernel upcall on %s for %s -> %s", - __PRETTY_FUNCTION__, ifp->name, ip_src_str, ip_dst_str); + zlog_warn("%s: igmp kernel upcall on %s(%p) for %s -> %s", + __PRETTY_FUNCTION__, ifp->name, igmp, ip_src_str, ip_dst_str); } - - pim_igmp_packet(igmp, (char *)buf, buf_size); + if (igmp) + pim_igmp_packet(igmp, (char *)buf, buf_size); } else if (ip_hdr->ip_p) { if (PIM_DEBUG_MROUTE_DETAIL) {