mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
Fix UDP send to IPv6 link local addresses (#6541)
lwIP's tcp/udp_connect() and tcp/udp_bind() functions automatically set the zone if it is required but missing, but udp_connect() is not used so this doesn't happen. Explicitly set the zone to the default network interface if it is required for the type of address being used. Otherwise there is no zone set and packets to a link local destination don't go anywhere.
This commit is contained in:
parent
5511180cd1
commit
ee619d367f
@ -114,6 +114,12 @@ public:
|
||||
{
|
||||
_pcb->remote_ip = addr;
|
||||
_pcb->remote_port = port;
|
||||
#if LWIP_IPV6
|
||||
// Set zone so that link local addresses use the default interface
|
||||
if (IP_IS_V6(&_pcb->remote_ip) && ip6_addr_lacks_zone(ip_2_ip6(&_pcb->remote_ip), IP6_UNKNOWN)) {
|
||||
ip6_addr_assign_zone(ip_2_ip6(&_pcb->remote_ip),IP6_UNKNOWN, netif_default);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user