Skip to content

Fix for sending IPv6 UDP packet over link local interface #11877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/lwipstack/LWIPStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ nsapi_size_or_error_t LWIP::socket_sendto(nsapi_socket_t handle, const SocketAdd
}
if (netif_) {
if ((addr.version == NSAPI_IPv4 && !get_ipv4_addr(netif_)) ||
(addr.version == NSAPI_IPv6 && !get_ipv6_addr(netif_))) {
(addr.version == NSAPI_IPv6 && !get_ipv6_addr(netif_) && !get_ipv6_link_local_addr(netif_))) {
return NSAPI_ERROR_PARAMETER;
}
}
Expand Down
7 changes: 2 additions & 5 deletions features/lwipstack/lwip_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,8 @@ bool convert_mbed_addr_to_lwip(ip_addr_t *out, const nsapi_addr_t *in)

#if LWIP_IPV4 && LWIP_IPV6
if (in->version == NSAPI_UNSPEC) {
#if IP_VERSION_PREF == PREF_IPV4
ip_addr_set_zero_ip4(out);
#else
ip_addr_set_zero_ip6(out);
#endif
ip6_addr_set_zero(ip_2_ip6(out));
IP_SET_TYPE(out, IPADDR_TYPE_ANY);
return true;
}
#endif
Expand Down