HW address w/o connection in iphlpapi

most at museresearch.com most at museresearch.com
Tue Jan 17 13:05:29 CST 2006


Juan,

>> When you boot a linux box without an ethernet connection, and eth0
>> configuration fails, GetAdaptersInfo does not return MAC address info
>> for eth0.
>> The problem seems to be that enumerateInterfaces (in
>> dlls/iphlpapi/ifenum.c) doesn't create a record for eth0, because
>> SIOCGIFCONF doesn't return one.
>
> Mmm.  Yeah, I think an alternative to SIOCGIFCONF might be the thing.
> getifaddrs is pretty nice, and it has the additional advantage that it can
> support IPv6, which SIOCGIFCONF does not.  I'm not certain whether it
> returns "down" interfaces or not, but we can hope so.  Unfortunately it's

Dang. It doesn't work for down devices. When I run strace on a program
that uses getifaddrs, the socket is opened with IPROTO_IP:

socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 14
ioctl(14, 0x8912, 0x2084d3a8)           = 0
ioctl(14, 0x8912, 0x2084d3a8)           = 0
ioctl(14, 0x8913, 0x7804ab38)           = 0
ioctl(14, 0x891b, 0x7804ab38)           = 0
ioctl(14, 0x8919, 0x7804ab38)           = 0
ioctl(14, 0x8913, 0x7804ab58)           = 0
ioctl(14, 0x891b, 0x7804ab58)           = 0
ioctl(14, 0x8919, 0x7804ab58)           = 0

Could it be that eth0 doesn't appear because it isn't configured for IP...
that is, has no IP address? I can't figure out what these ioctls are
either...?

I'll keep digging, but if you have any clues I would love to hear them! I
am shuffling in the dark here... mo

PS: I've attached a diff file that implements getifaddrs for our Wine,
20050419. I didn't do the "configure" step, but put HAVE_IFADDRS_H in.
Your code is left in if HAVE_IFADDRS_H is not defined. If you want, take
it, check it out and adapt it to the current wine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifenum.patch
Type: application/octet-stream
Size: 3840 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060117/a7db3f56/ifenum.obj


More information about the wine-devel mailing list