- Notifications
You must be signed in to change notification settings - Fork7.8k
Commitd6a76da
authored
fix(libraries/asyncudp): IPv4 ONLY listenMulticast() (#11444)
AsyncUDP::listenMulticast() properly receives packets sent to IPv4multicast addresses like 239.1.2.3, but it is not receiving packets sentto IPv6 multicast addresses like ff12::6ood:cafe.The root cause is a bit hidden: listen(NULL, port) would matchAsyncUDP::listen(const ip_addr_t *addr, uint16_t port), which calls_udp_bind(_pcb, addr, port), which uses the lwIP API to calludp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) atthe end. If lwIP has LWIP_IPV4 enabled, it checks if ipaddr == NULL andsets it to IP4_ADDR_ANY. So an IPv6 address is never bound.This fix checks the IP address passed to AsyncUDP::listenMulticast(). Ifit 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).1 parent0aada09 commitd6a76da
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| 685 | + | |
| 686 | + | |
685 | 687 | | |
686 | 688 | | |
687 | 689 | | |
| |||
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
693 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
694 | 707 | | |
695 | 708 | | |
696 | 709 | | |
| |||
0 commit comments
Comments
(0)