From 6b033cc1e61a1ac50753b52c1b267f34a3a7ee54 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Thu, 21 Dec 2006 14:47:20 +0100 Subject: [PATCH] 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. --- dlls/iphlpapi/ifenum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c index 52e84135aa..fb3348f806 100644 --- a/dlls/iphlpapi/ifenum.c +++ b/dlls/iphlpapi/ifenum.c @@ -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;