diff options
| author | Mobashshera Rasool <mrasool@vmware.com> | 2020-10-14 13:51:32 +0000 | 
|---|---|---|
| committer | Mobashshera Rasool <mrasool@vmware.com> | 2020-11-17 13:34:12 +0000 | 
| commit | 9041c30ad1a8db6be436bc24421fabdd5ad54a6b (patch) | |
| tree | 266d590f50baad77f4a9cbb415f677f46df998a3 /pimd/pim_igmpv2.c | |
| parent | b131b5f539962c2a438cd7434bd83e14888437b7 (diff) | |
pimd: checksum must be validated before accepting igmp packets
Issue: When an IGMPv2 leave packet is received, it did not validate
the checksum and hence the packet is accepted and group specific
query is sent out in response to this.
Due to this IGMP conformance test case 6.1 failed.
https://github.com/FRRouting/frr/issues/6868
Fix: Validate the checksum for all IGMP packets
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'pimd/pim_igmpv2.c')
| -rw-r--r-- | pimd/pim_igmpv2.c | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/pimd/pim_igmpv2.c b/pimd/pim_igmpv2.c index af598d040d..d836c66cbb 100644 --- a/pimd/pim_igmpv2.c +++ b/pimd/pim_igmpv2.c @@ -121,6 +121,13 @@ int igmp_v2_recv_report(struct igmp_sock *igmp, struct in_addr from,  		return -1;  	} +	if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) { +		zlog_warn( +			"Recv IGMPv2 REPORT from %s on %s: size=%d with invalid checksum", +			from_str, ifp->name, igmp_msg_len); +		return -1; +	} +  	/* Collecting IGMP Rx stats */  	igmp->rx_stats.report_v2++; @@ -170,6 +177,13 @@ int igmp_v2_recv_leave(struct igmp_sock *igmp, struct in_addr from,  		return -1;  	} +	if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) { +		zlog_warn( +			"Recv IGMPv2 LEAVE from %s on %s with invalid checksum", +			from_str, ifp->name); +		return -1; +	} +  	/* Collecting IGMP Rx stats */  	igmp->rx_stats.leave_v2++;  | 
