back-port ajax16384's fix to enum_net_interfaces on windows

This commit is contained in:
arvidn 2017-02-08 07:56:20 -05:00 committed by Arvid Norberg
parent 61f9f6bb7f
commit 964542e53b
1 changed files with 7 additions and 0 deletions

View File

@ -630,6 +630,13 @@ namespace libtorrent
IP_ADAPTER_UNICAST_ADDRESS* unicast = adapter->FirstUnicastAddress;
while (unicast)
{
if (unicast->Address.lpSockaddr->sa_family != AF_INET
#if TORRENT_USE_IPV6
&& unicast->Address.lpSockaddr->sa_family != AF_INET6
#endif
)
continue;
r.interface_address = sockaddr_to_address(unicast->Address.lpSockaddr);
ret.push_back(r);