summaryrefslogtreecommitdiff
path: root/pimd/pim_igmpv2.c
diff options
context:
space:
mode:
authorMobashshera Rasool <mrasool@vmware.com>2022-01-13 00:07:12 -0800
committerMobashshera Rasool <mrasool@vmware.com>2022-01-13 00:21:43 -0800
commit69b9ea0b496dd02aabda038465ba6b59bf1b3810 (patch)
treeffc2b5150067f291bb8865455b5cf239692fe551 /pimd/pim_igmpv2.c
parent3b93886add3b28acec698da8a50cf8c87eb16e4e (diff)
pimd: IGMPv2 leave msg may be longer than 8 octets
Fix the code as per RFC 2236 section 2.5: Note that IGMP messages may be longer than 8 octets, especially future backwards-compatible versions of IGMP. As long as the Type is one that is recognized, an IGMPv2 implementation MUST ignore anything past the first 8 octets while processing the packet. However, the IGMP checksum is always computed over the whole IP payload, not just over the first 8 octets. Fixes: #10331 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'pimd/pim_igmpv2.c')
-rw-r--r--pimd/pim_igmpv2.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pimd/pim_igmpv2.c b/pimd/pim_igmpv2.c
index dc18e1593d..a7c7c99ebf 100644
--- a/pimd/pim_igmpv2.c
+++ b/pimd/pim_igmpv2.c
@@ -173,10 +173,11 @@ int igmp_v2_recv_leave(struct gm_sock *igmp, struct ip *ip_hdr,
return 0;
if (igmp_msg_len != IGMP_V12_MSG_SIZE) {
- zlog_warn(
- "Recv IGMPv2 LEAVE from %s on %s: size=%d other than correct=%d",
- from_str, ifp->name, igmp_msg_len, IGMP_V12_MSG_SIZE);
- return -1;
+ if (PIM_DEBUG_IGMP_PACKETS)
+ zlog_debug(
+ "Recv IGMPv2 LEAVE from %s on %s: size=%d other than correct=%d",
+ from_str, ifp->name, igmp_msg_len,
+ IGMP_V12_MSG_SIZE);
}
if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) {