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>
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)
/* 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) {