Author: pschweitzer
Date: Tue Dec 8 08:03:33 2015
New Revision: 70292
URL:
http://svn.reactos.org/svn/reactos?rev=70292&view=rev
Log:
[IPHLPAPI]
Properly return unicast addresses in GetAdaptersAddresses() by properly return a struct
sockaddr_in.
This fixes a bunch of failing tests in iphlpapi_apitest, and it should fix any application
relying on this API to know interfaces addresses.
Modified:
trunk/reactos/dll/win32/iphlpapi/address.c
Modified: trunk/reactos/dll/win32/iphlpapi/address.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/address…
==============================================================================
--- trunk/reactos/dll/win32/iphlpapi/address.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/iphlpapi/address.c [iso-8859-1] Tue Dec 8 08:03:33 2015
@@ -588,9 +588,10 @@
/* Set the address */
//FIXME: ipv4 only (again...)
UnicastAddress->Address.lpSockaddr =
(LPSOCKADDR)(UnicastAddress + 1);
- UnicastAddress->Address.iSockaddrLength =
sizeof(AddrEntries[j].iae_addr);
+ UnicastAddress->Address.iSockaddrLength = sizeof(SOCKADDR);
UnicastAddress->Address.lpSockaddr->sa_family = AF_INET;
- memcpy(UnicastAddress->Address.lpSockaddr->sa_data,
&AddrEntries[j].iae_addr, sizeof(AddrEntries[j].iae_addr));
+
((LPSOCKADDR_IN)UnicastAddress->Address.lpSockaddr)->sin_port = 0;
+
memcpy(&((LPSOCKADDR_IN)UnicastAddress->Address.lpSockaddr)->sin_addr,
&AddrEntries[j].iae_addr, sizeof(AddrEntries[j].iae_addr));
CurrentAA->FirstUnicastAddress = UnicastAddress;
Ptr += Size;