Commit 6b033cc1 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

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.
parent 9ff16186
...@@ -690,7 +690,7 @@ static DWORD enumIPAddresses(PDWORD pcAddresses, struct ifconf *ifc) ...@@ -690,7 +690,7 @@ static DWORD enumIPAddresses(PDWORD pcAddresses, struct ifconf *ifc)
ifc->ifc_buf = HeapAlloc(GetProcessHeap(), 0, ifc->ifc_len); ifc->ifc_buf = HeapAlloc(GetProcessHeap(), 0, ifc->ifc_len);
ioctlRet = ioctl(fd, SIOCGIFCONF, ifc); ioctlRet = ioctl(fd, SIOCGIFCONF, ifc);
} while (ioctlRet == 0 && } while (ioctlRet == 0 &&
ifc->ifc_len == (sizeof(struct ifreq) * guessedNumAddresses)); ifc->ifc_len > (sizeof(struct ifreq) * (guessedNumAddresses - 2)));
if (ioctlRet == 0) { if (ioctlRet == 0) {
ifPtr = ifc->ifc_buf; ifPtr = ifc->ifc_buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment