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:
parent
9ff161860c
commit
6b033cc1e6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue