http://bugs.winehq.org/show_bug.cgi?id=33152
Bug #: 33152 Summary: GetAdaptersAddresses reports incorrect address family for IPv4 addresses Product: Wine Version: 1.5.25 Platform: x86 OS/Version: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: iphlpapi AssignedTo: wine-bugs@winehq.org ReportedBy: filip.navara@gmail.com Classification: Unclassified
Created attachment 43859 --> http://bugs.winehq.org/attachment.cgi?id=43859 Test program
The GetAdaptersAddresses API reports incorrect address family for IPv4 unicast addresses on OS X. I suspect it may be a memory corruption or some aliasing bug in the compiler or the source code.
Attached test program is modified sample from MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).as...) that prints the address family value for unicast addresses.
For IPv6 addresses the address family is correctly reported as 23, for IPv4 it should be 2, but the actual reported value is pretty random (most commonly 512).
Log from the test program:
Length of the IP_ADAPTER_ADDRESS struct: 368 IfIndex (IPv4 interface): 1 Adapter name: lo0 Address length: 16 Address family: 512 Address length: 28 Address family: 23 Address length: 28 Address family: 23 Number of Unicast Addresses: 3
This also breaks .NET programs that use the NetworkInterface class. Tested on Wine 1.5.25 and Crossover 12.1.2.
http://bugs.winehq.org/show_bug.cgi?id=33152
--- Comment #1 from Hans Leidekker hans@meelstraat.net 2013-03-09 04:37:34 CST --- Created attachment 43863 --> http://bugs.winehq.org/attachment.cgi?id=43863 patch
Does this help?
http://bugs.winehq.org/show_bug.cgi?id=33152
--- Comment #2 from Filip Navara filip.navara@gmail.com 2013-03-09 04:44:49 CST --- Created attachment 43865 --> http://bugs.winehq.org/attachment.cgi?id=43865 patch 2
This modified version of your patch does...
http://bugs.winehq.org/show_bug.cgi?id=33152
--- Comment #3 from Hans Leidekker hans@meelstraat.net 2013-03-09 04:53:55 CST --- (In reply to comment #2)
Created attachment 43865 [details] patch 2
This modified version of your patch does...
Heh, looks like I didn't save my buffer. Care to submit it?
http://bugs.winehq.org/show_bug.cgi?id=33152
--- Comment #4 from Filip Navara filip.navara@gmail.com 2013-03-09 05:05:31 CST --- Done. Thanks for quick help!
http://bugs.winehq.org/show_bug.cgi?id=33152
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |7ca40003d2101c73e97acb5c1f1 | |643c8ef1674c6 Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #5 from Hans Leidekker hans@meelstraat.net 2013-03-12 14:39:21 CDT --- Fixed by 7ca40003d2101c73e97acb5c1f1643c8ef1674c6.
http://bugs.winehq.org/show_bug.cgi?id=33152
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2013-03-15 14:47:12 CDT --- Closing bugs fixed in 1.5.26.