mirror of
https://github.com/apache/nuttx.git
synced 2026-08-08 14:07:17 +00:00
igmp_input() validated the IGMP checksum with: if (net_chksum((FAR uint16_t *)igmp, IGMP_HDRLEN) != 0) but net_chksum() returns the raw one's complement sum of the 16-bit words (it does NOT take the one's complement of that sum). For a valid IGMP packet whose checksum field holds ~S (as written by igmp_send()), the sum of all 16-bit words is S + ~S = 0xffff, never 0. So the existing check `!= 0` was always true for any well-formed IGMP message, sending every valid packet down the "Checksum error" path to be silently dropped and breaking IGMP membership query/report processing. Compare against 0xffff instead, matching the convention used by the other transport input handlers: - ipv4_input.c: (ipv4_chksum(IPv4BUF) != 0xffff) - tcp_input.c: (tcp_chksum(dev) != 0xffff) This is also consistent with the sender side in igmp_send.c, which stores `igmp->chksum = ~igmp_chksum(...)`. Signed-off-by: zhekunren <zhekunren@qq.com> Assisted-by: GLM-5.2 <noreply@z.ai> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| igmp.h | ||
| igmp_group.c | ||
| igmp_initialize.c | ||
| igmp_input.c | ||
| igmp_join.c | ||
| igmp_leave.c | ||
| igmp_mcastmac.c | ||
| igmp_msg.c | ||
| igmp_poll.c | ||
| igmp_send.c | ||
| igmp_timer.c | ||
| Kconfig | ||
| Make.defs | ||