arduino-esp32/libraries/AsyncUDP
Niki Waibel d6a76da0a5
fix(libraries/asyncudp): IPv4 ONLY listenMulticast() (#11444)
AsyncUDP::listenMulticast() properly receives packets sent to IPv4
multicast addresses like 239.1.2.3, but it is not receiving packets sent
to IPv6 multicast addresses like ff12::6ood:cafe.

The root cause is a bit hidden: listen(NULL, port) would match
AsyncUDP::listen(const ip_addr_t *addr, uint16_t port), which calls
_udp_bind(_pcb, addr, port), which uses the lwIP API to call
udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) at
the end. If lwIP has LWIP_IPV4 enabled, it checks if ipaddr == NULL and
sets it to IP4_ADDR_ANY. So an IPv6 address is never bound.

This fix checks the IP address passed to AsyncUDP::listenMulticast(). If
it is an IPv6 address, it constructs and passes the IPv6 any address
(::); otherwise (IPv4), it constructs and passes the IPv4 any address
(0.0.0.0).
2025-06-10 11:55:43 +03:00
..
examples ci(json): Improve requirement checking (#10554) 2024-11-06 18:08:16 +02:00
src fix(libraries/asyncudp): IPv4 ONLY listenMulticast() (#11444) 2025-06-10 11:55:43 +03:00
keywords.txt AsyncUdp license and keyword update (#10637) 2024-11-25 14:04:20 +02:00
library.properties Update core version to 3.2.0 2025-02-18 19:10:54 +02:00