mirror of
https://github.com/apache/nuttx.git
synced 2026-09-07 01:16:36 +00:00
igmp_input() verified the packet length with:
if (dev->d_len < NET_LL_HDRLEN(dev) + (iphdrlen + IGMP_HDRLEN))
but dev->d_len at this point holds the IPv4 total length (IP header plus
payload) without the link-layer header, consistent with the convention
established in ipv4_in()/ipv6_in() (which do `dev->d_len -=
NET_LL_HDRLEN(dev)`) and used by all other transport input handlers
(icmp, tcp, udp), none of which reference NET_LL_HDRLEN.
Adding NET_LL_HDRLEN(dev) to the right-hand side made the check always
true for valid IGMP packets:
iphdrlen + IGMP_HDRLEN < NET_LL_HDRLEN + iphdrlen + IGMP_HDRLEN
(= 0 < NET_LL_HDRLEN)
so every well-formed IGMP message hit the "Length error" path and was
silently dropped, breaking IGMP membership query/report processing.
Drop the extra NET_LL_HDRLEN(dev) so the check matches the other
protocol handlers.
Signed-off-by: zhekunren <zhekunren@qq.com>
|
||
|---|---|---|
| .. | ||
| 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 | ||