Skip to content

Commit

Permalink
Merge branch 'master' into bugfix2/ESP8266HTTPClient
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v authored Apr 11, 2020
2 parents c7a19f5 + 4f27ce1 commit c4e0cbe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/ESP8266WiFi/src/include/ClientContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,14 @@ class ClientContext
}
}

int connect(CONST ip_addr_t* addr, uint16_t port)
int connect(ip_addr_t* addr, uint16_t port)
{
#if LWIP_IPV6
// Set zone so that link local addresses use the default interface
if (IP_IS_V6(addr) && ip6_addr_lacks_zone(ip_2_ip6(addr), IP6_UNKNOWN)) {
ip6_addr_assign_zone(ip_2_ip6(addr), IP6_UNKNOWN, netif_default);
}
#endif
err_t err = tcp_connect(_pcb, addr, port, &ClientContext::_s_connected);
if (err != ERR_OK) {
return 0;
Expand Down
6 changes: 6 additions & 0 deletions libraries/ESP8266WiFi/src/include/UdpContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ class UdpContext
{
_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;
}

Expand Down

0 comments on commit c4e0cbe

Please sign in to comment.