[SAL] fix the IPv4&v6 compiling issue. (#7938)
This commit is contained in:
parent
9968f84c2b
commit
f307a2cd5d
|
@ -1097,7 +1097,14 @@ int sal_ioctlsocket(int socket, long cmd, void *arg)
|
|||
if (!strcmp(ifr->ifr_ifrn.ifrn_name, netdev->name))
|
||||
{
|
||||
addr_in = (struct sockaddr_in *)&(ifr->ifr_ifru.ifru_addr);
|
||||
addr_in->sin_addr.s_addr = netdev->ip_addr.addr;
|
||||
#if NETDEV_IPV4 && NETDEV_IPV6
|
||||
addr_in->sin_addr.s_addr = sock->netdev->ip_addr.u_addr.ip4.addr;
|
||||
#elif NETDEV_IPV4
|
||||
addr_in->sin_addr.s_addr = sock->netdev->ip_addr.addr;
|
||||
#elif NETDEV_IPV6
|
||||
#error "Do not only support IPV6"
|
||||
#endif /* NETDEV_IPV4 && NETDEV_IPV6 */
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue