igmp: handle IGMPv1/v2 reports and v2 leaves

Only frames to 01:00:5e:00:00:16 reached the IGMP handler, so v1/v2
reports, which go to the group address, were never seen. The handler
also took the group from the first v3 group record for every type.

Pass all IPv4 multicast to the handler, which takes the IGMP header
from the IP header length, the group from the IGMP header for v1/v2
reports and v2 leaves and from the first group record for v3, and
returns 0 for anything that is not IGMP so it goes on to the IP stack.
The message and record types have names now.
This commit is contained in:
DrDoof committed 2026-10-01 20:42:22 +02:00
1 parent f0aea3dcac
commit 87db2dd4b8
4 files changed
+60 -23

No files matched your search

+1 -2
View File
@@ -1052,8 +1052,7 @@ void handle_rx(void)
tcpip_output();
}
} else if (igmpEnabled && uip_buf[0] == 0x01 && uip_buf[1] == 0x00 && uip_buf[2] == 0x5e // IPv4-MC packet?
&& uip_buf[3] == 0x00 && uip_buf[4] == 0x00 && uip_buf[5] == 0x16) {
igmp_packet_handler();
&& igmp_packet_handler()) {
if (uip_len) {
tcpip_output();
}