diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-05-25 13:15:14 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-05-25 20:05:49 -0400 | 
| commit | c7c5d685c07f810fd3185dd76817f5356a9fc7ee (patch) | |
| tree | 86f58f9f03d31819c5734048129ef506cb499229 /pimd/pim_igmpv3.c | |
| parent | 1ebae15eaff974b4ac264cebef2a0fd273bbb2da (diff) | |
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 <sharpd@nvidia.com>
Diffstat (limited to 'pimd/pim_igmpv3.c')
| -rw-r--r-- | pimd/pim_igmpv3.c | 8 | 
1 files changed, 8 insertions, 0 deletions
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) {  | 
