[PATCH 0/1] MR10272: iphlpapi: Swap the order of address families in call_families to process IPv4...
A Ruby application obtains network adapter IP information by calling the **Win32_NetworkAdapterConfiguration** class. However, the order of IPv4 and IPv6 addresses retrieved on Windows differs from that retrieved when running on Wine, which causes Ruby applications running on Wine to malfunction. A test demo was written that calls the **Win32_NetworkAdapterConfiguration** class to obtain network adapter information. It was run on Windows and on Wine respectively, and the results are as follows. The results of running on Windows: {width=357 height=153} The results of running on Wine: {width=363 height=66} -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10272
From: Zhao Yi <zhaoyi@uniontech.com> Signed-off-by: Zhao Yi <zhaoyi@uniontech.com> --- dlls/iphlpapi/iphlpapi_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index fe2de41c4a3..c850de9d900 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1150,15 +1150,15 @@ static DWORD call_families( DWORD (*fn)( IP_ADAPTER_ADDRESSES *aa, ULONG family, { DWORD err; - if (family != AF_INET) + if (family != AF_INET6) { - err = fn( aa, AF_INET6, flags ); + err = fn( aa, AF_INET, flags ); if (err) return err; } - if (family != AF_INET6) + if (family != AF_INET) { - err = fn( aa, AF_INET, flags ); + err = fn( aa, AF_INET6, flags ); if (err) return err; } return err; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10272
This should probably be tested in both iphlpapi and wmi. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10272#note_131567
Also call_families affects various functions, if it is indeed iphlpapi output order is wrong in some maybe it needs explicit sorting. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10272#note_131600
participants (4)
-
Nikolay Sivov (@nsivov) -
Paul Gofman (@gofman) -
Zhao Yi -
Zhao Yi (@Zhaoyi)