Fix sockets on MSVC after IPv6 zone work

This fixes the following build failure with MSVC 2013:

sockets.c(323): warning C4242: '=' : conversion from 'const u32_t' to 'u8_t', possible loss of data

This casts sin6_scope_id to a u8_t before calling ip6_addr_set_zone()
This commit is contained in:
Joel Cunningham 2017-02-07 10:03:33 -06:00
parent 8a34570b83
commit a0a64a59ba

View File

@ -100,7 +100,7 @@
#define SOCKADDR6_TO_IP6ADDR_PORT(sin6, ipaddr, port) do { \
inet6_addr_to_ip6addr(ip_2_ip6(ipaddr), &((sin6)->sin6_addr)); \
if (ip6_addr_has_scope(ip_2_ip6(ipaddr), IP6_UNKNOWN)) { \
ip6_addr_set_zone(ip_2_ip6(ipaddr), (sin6)->sin6_scope_id); \
ip6_addr_set_zone(ip_2_ip6(ipaddr), (u8_t)(sin6)->sin6_scope_id); \
} \
(port) = lwip_ntohs((sin6)->sin6_port); }while(0)
#endif /* LWIP_IPV6 */