iphlpapi: Fixed a problem with enumerating network interfaces.

Keep increasing the buffer until the returned length is more than two
records smaller than the buffer we provided.
This commit is contained in:
Ken Thomases 2006-12-21 14:47:20 +01:00 committed by Alexandre Julliard
parent 9ff161860c
commit 6b033cc1e6
1 changed files with 1 additions and 1 deletions

View File

@ -690,7 +690,7 @@ static DWORD enumIPAddresses(PDWORD pcAddresses, struct ifconf *ifc)
ifc->ifc_buf = HeapAlloc(GetProcessHeap(), 0, ifc->ifc_len);
ioctlRet = ioctl(fd, SIOCGIFCONF, ifc);
} while (ioctlRet == 0 &&
ifc->ifc_len == (sizeof(struct ifreq) * guessedNumAddresses));
ifc->ifc_len > (sizeof(struct ifreq) * (guessedNumAddresses - 2)));
if (ioctlRet == 0) {
ifPtr = ifc->ifc_buf;