Skip to content

Commit

Permalink
credit: Simon Arlott @nomis - similar to esp8266#6541 for TCP
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v committed Apr 11, 2020
1 parent ee619d3 commit 5d380cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/include/UdpContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class UdpContext
#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);
ip6_addr_assign_zone(ip_2_ip6(&_pcb->remote_ip), IP6_UNKNOWN, netif_default);
}
#endif
return true;
Expand Down

0 comments on commit 5d380cb

Please sign in to comment.