Merge pull request #10334 from mobash-rasool/igmp-conf-fix

pimd: IGMP messages may be longer than 8 octets
This commit is contained in:
Donald Sharp 2022-01-13 09:00:51 -05:00 committed by GitHub
commit a64abeefdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,10 +115,11 @@ int igmp_v2_recv_report(struct gm_sock *igmp, struct in_addr from,
return 0; return 0;
if (igmp_msg_len != IGMP_V12_MSG_SIZE) { if (igmp_msg_len != IGMP_V12_MSG_SIZE) {
zlog_warn( if (PIM_DEBUG_IGMP_PACKETS)
zlog_debug(
"Recv IGMPv2 REPORT from %s on %s: size=%d other than correct=%d", "Recv IGMPv2 REPORT from %s on %s: size=%d other than correct=%d",
from_str, ifp->name, igmp_msg_len, IGMP_V12_MSG_SIZE); from_str, ifp->name, igmp_msg_len,
return -1; IGMP_V12_MSG_SIZE);
} }
if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) { if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) {
@ -172,10 +173,11 @@ int igmp_v2_recv_leave(struct gm_sock *igmp, struct ip *ip_hdr,
return 0; return 0;
if (igmp_msg_len != IGMP_V12_MSG_SIZE) { if (igmp_msg_len != IGMP_V12_MSG_SIZE) {
zlog_warn( if (PIM_DEBUG_IGMP_PACKETS)
zlog_debug(
"Recv IGMPv2 LEAVE from %s on %s: size=%d other than correct=%d", "Recv IGMPv2 LEAVE from %s on %s: size=%d other than correct=%d",
from_str, ifp->name, igmp_msg_len, IGMP_V12_MSG_SIZE); from_str, ifp->name, igmp_msg_len,
return -1; IGMP_V12_MSG_SIZE);
} }
if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) { if (igmp_validate_checksum(igmp_msg, igmp_msg_len) == -1) {