fix regression in windows implementation of enum_net causing infinite loop

This commit is contained in:
arvidn 2017-02-11 15:47:22 -05:00 committed by Arvid Norberg
parent 85f6febfff
commit 949d4cd12a
1 changed files with 2 additions and 4 deletions

View File

@ -627,8 +627,8 @@ namespace libtorrent
strncpy(r.name, adapter->AdapterName, sizeof(r.name));
r.name[sizeof(r.name)-1] = 0;
r.mtu = adapter->Mtu;
IP_ADAPTER_UNICAST_ADDRESS* unicast = adapter->FirstUnicastAddress;
while (unicast)
for (IP_ADAPTER_UNICAST_ADDRESS* unicast = adapter->FirstUnicastAddress;
unicast; unicast = unicast->Next)
{
if (unicast->Address.lpSockaddr->sa_family != AF_INET
#if TORRENT_USE_IPV6
@ -640,8 +640,6 @@ namespace libtorrent
r.interface_address = sockaddr_to_address(unicast->Address.lpSockaddr);
ret.push_back(r);
unicast = unicast->Next;
}
}