]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: fix igmp source packet check 12245/head
authorMobashshera Rasool <mrasool@vmware.com>
Wed, 2 Nov 2022 10:17:30 +0000 (03:17 -0700)
committerMobashshera Rasool <mrasool@vmware.com>
Wed, 2 Nov 2022 10:23:23 +0000 (03:23 -0700)
ip source 0.0.0.0 is OK as per RFC 3376: 4.2.13.

Co-authored-by: ron <lyq140hf2006@163.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd/pim_mroute.c

index 220706945daf158be81700558b635b12eddca322..f1fd2ef73506cbbb9940a6761095aebdcc853103 100644 (file)
@@ -634,7 +634,7 @@ static int process_igmp_packet(struct pim_instance *pim, const char *buf,
 
        connected_src = pim_if_connected_to_source(ifp, ip_hdr->ip_src);
 
-       if (!connected_src) {
+       if (!connected_src && !pim_addr_is_any(ip_hdr->ip_src)) {
                if (PIM_DEBUG_GM_PACKETS) {
                        zlog_debug(
                                "Recv IGMP packet on interface: %s from a non-connected source: %pI4",
@@ -644,7 +644,8 @@ static int process_igmp_packet(struct pim_instance *pim, const char *buf,
        }
 
        pim_ifp = ifp->info;
-       ifaddr = connected_src->u.prefix4;
+       ifaddr = connected_src ? connected_src->u.prefix4
+                              : pim_ifp->primary_address;
        igmp = pim_igmp_sock_lookup_ifaddr(pim_ifp->gm_socket_list, ifaddr);
 
        if (PIM_DEBUG_GM_PACKETS) {
@@ -655,11 +656,11 @@ static int process_igmp_packet(struct pim_instance *pim, const char *buf,
        }
        if (igmp)
                pim_igmp_packet(igmp, (char *)buf, buf_size);
-       else if (PIM_DEBUG_GM_PACKETS) {
+       else if (PIM_DEBUG_GM_PACKETS)
                zlog_debug(
-                       "No IGMP socket on interface: %s with connected source: %pFX",
-                       ifp->name, connected_src);
-       }
+                       "No IGMP socket on interface: %s with connected source: %pI4",
+                       ifp->name, &ifaddr);
+
        return 0;
 }
 #endif