]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Disable handling v3 igmp packets on an interface config'ed for v2
authorDonald Sharp <sharpd@nvidia.com>
Wed, 25 May 2022 17:15:14 +0000 (13:15 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 26 May 2022 00:05:49 +0000 (20:05 -0400)
pimd is receiving v3 igmp packets on an interface that is setup as v2 and
causing the igmp group as configured on that interface to get a bit
wonky.

Add a check to receiving v3 packets and to drop the packet if the
igmp version configed on the interface is 2.

Fixes: #11105
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
pimd/pim_igmpv3.c

index 6ba48d6488f3c11256e77582948151f7bcb5afd1..6ed5c501b20d6e797b961ac5310f03c4d723f077 100644 (file)
@@ -1890,6 +1890,7 @@ int igmp_v3_recv_report(struct gm_sock *igmp, struct in_addr from,
        uint8_t *group_record;
        uint8_t *report_pastend = (uint8_t *)igmp_msg + igmp_msg_len;
        struct interface *ifp = igmp->interface;
+       struct pim_interface *pim_ifp = ifp->info;
        int i;
 
        if (igmp->mtrace_only)
@@ -1913,6 +1914,13 @@ int igmp_v3_recv_report(struct gm_sock *igmp, struct in_addr from,
        /* Collecting IGMP Rx stats */
        igmp->igmp_stats.report_v3++;
 
+       if (pim_ifp->igmp_version == 2) {
+               zlog_warn(
+                       "Received Version 3 packet but interface: %s is configured for version 2",
+                       ifp->name);
+               return -1;
+       }
+
        num_groups = ntohs(
                *(uint16_t *)(igmp_msg + IGMP_V3_REPORT_NUMGROUPS_OFFSET));
        if (num_groups < 1) {