mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-23 21:14:18 +00:00
sockets IPv6: cast interface index to u8_t
Interface indexes are u8_t internally so cast from sockets int representation to u8_t This was found with MSVC 2013: 1>lwip\src\api\sockets.c(3190): warning C4242: 'function' : conversion from 'const unsigned int' to 'u8_t', possible loss of data 1>lwip\src\api\sockets.c(3698): warning C4242: 'function' : conversion from 'unsigned int' to 'u8_t', possible loss of data
This commit is contained in:
parent
339ec17cf0
commit
3bdb34886c
@ -3187,7 +3187,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
||||
const struct ipv6_mreq *imr = (const struct ipv6_mreq *)optval;
|
||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct ipv6_mreq, NETCONN_UDP);
|
||||
inet6_addr_to_ip6addr(&multi_addr, &imr->ipv6mr_multiaddr);
|
||||
netif = netif_get_by_index(imr->ipv6mr_interface);
|
||||
netif = netif_get_by_index((u8_t)imr->ipv6mr_interface);
|
||||
if (netif == NULL) {
|
||||
err = EADDRNOTAVAIL;
|
||||
break;
|
||||
@ -3695,7 +3695,7 @@ lwip_socket_drop_registered_mld6_memberships(int s)
|
||||
ip_addr_t multi_addr;
|
||||
struct netif *netif;
|
||||
ip_addr_copy_from_ip6(multi_addr, socket_ipv6_multicast_memberships[i].multi_addr);
|
||||
netif = netif_get_by_index(socket_ipv6_multicast_memberships[i].if_idx);
|
||||
netif = netif_get_by_index((u8_t)socket_ipv6_multicast_memberships[i].if_idx);
|
||||
if (netif == NULL) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user