mirror of https://github.com/ARMmbed/mbed-os.git
Modified LwIP stack and LwIP mbed-os wrapper to support sending IPv6
UDP packets when IPv4 and IPv6 dual mode stack is enabled and the IPv6 packet is sent over link-local inerface.pull/11877/head
parent
fd22997b60
commit
dc7178f176
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue