From: Donald Sharp Date: Wed, 25 May 2022 17:15:14 +0000 (-0400) Subject: pimd: Disable handling v3 igmp packets on an interface config'ed for v2 X-Git-Tag: base_8.3~22^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c7c5d685c07f810fd3185dd76817f5356a9fc7ee;p=matthieu%2Ffrr.git pimd: Disable handling v3 igmp packets on an interface config'ed for v2 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 --- diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 6ba48d6488..6ed5c501b2 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -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) {