Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee619d3

Browse files
authored
Fix UDP send to IPv6 link local addresses (#6541)
lwIP's tcp/udp_connect() and tcp/udp_bind() functions automaticallyset the zone if it is required but missing, but udp_connect() is notused so this doesn't happen.Explicitly set the zone to the default network interface if it isrequired for the type of address being used. Otherwise there is nozone set and packets to a link local destination don't go anywhere.
1 parent5511180 commitee619d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎libraries/ESP8266WiFi/src/include/UdpContext.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ class UdpContext
114114
{
115115
_pcb->remote_ip = addr;
116116
_pcb->remote_port = port;
117+
#if LWIP_IPV6
118+
// Set zone so that link local addresses use the default interface
119+
if (IP_IS_V6(&_pcb->remote_ip) &&ip6_addr_lacks_zone(ip_2_ip6(&_pcb->remote_ip), IP6_UNKNOWN)) {
120+
ip6_addr_assign_zone(ip_2_ip6(&_pcb->remote_ip),IP6_UNKNOWN, netif_default);
121+
}
122+
#endif
117123
returntrue;
118124
}
119125

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp