[Bug 6767] New: failure enumerating interfaces on NetBSD

Wine Bugs wine-bugs at winehq.org
Sat Nov 25 00:11:13 CST 2006


http://bugs.winehq.org/show_bug.cgi?id=6767

           Summary: failure enumerating interfaces on NetBSD
           Product: Wine
           Version: 0.9.25.
          Platform: PC
        OS/Version: NetBSD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: wine-net
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: jmmikkel at mit.edu


I'm running wine on NetBSD 4-BETA. I am getting the following error:

err:winsock:WSAIoctl Unable to get interface table!

I traced this down to dlls/iphlpapi/ifenum.c. The enumIPAddresses() function
uses the SIOCGIFCONF ioctl to get a list of interfaces on the system. It has the
comment "there is no way to know the interface count beforehand, so we need to
loop ... until returned < max". Unfortunately the algorithm is failing because
the ioctl is returning the _required_ length in ifc_len, even when that is
larger than the provided buffer.

So on NetBSD there actually is a way to know how much to allocate, but I figure
there might have to be a special configure test written just for this. A simpler
solution that fixed my problem and I think will work in general:

--- ifenum.c~   2006-11-10 11:32:16.000000000 -0500
+++ ifenum.c    2006-11-24 21:40:36.000000000 -0500
@@ -690,7 +690,7 @@
       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));
 
     if (ioctlRet == 0) {
       ifPtr = ifc->ifc_buf;

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list