From 7ca40003d2101c73e97acb5c1f1643c8ef1674c6 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sat, 9 Mar 2013 12:04:17 +0100 Subject: [PATCH] iphlpapi: Use prefixed WS_ structures to avoid misalignment on OS X builds. Thanks to Hans Leidekker for diagnosing the problem. --- dlls/iphlpapi/iphlpapi_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 600bf8c1b18..aeb91c1eb5b 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -848,7 +848,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index if (num_v4addrs) { IP_ADAPTER_UNICAST_ADDRESS *ua; - struct sockaddr_in *sa; + struct WS_sockaddr_in *sa; aa->Flags |= IP_ADAPTER_IPV4_ENABLED; ua = aa->FirstUnicastAddress = (IP_ADAPTER_UNICAST_ADDRESS *)ptr; for (i = 0; i < num_v4addrs; i++) @@ -860,12 +860,12 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index ua->Address.iSockaddrLength = sizeof(struct sockaddr_in); ua->Address.lpSockaddr = (SOCKADDR *)((char *)ua + ua->u.s.Length); - sa = (struct sockaddr_in *)ua->Address.lpSockaddr; - sa->sin_family = AF_INET; - sa->sin_addr.s_addr = v4addrs[i]; - sa->sin_port = 0; + sa = (struct WS_sockaddr_in *)ua->Address.lpSockaddr; + sa->sin_family = WS_AF_INET; + sa->sin_addr.S_un.S_addr = v4addrs[i]; + sa->sin_port = 0; TRACE("IPv4 %d/%d: %s\n", i + 1, num_v4addrs, - debugstr_ipv4(&sa->sin_addr.s_addr, addr_buf)); + debugstr_ipv4(&sa->sin_addr.S_un.S_addr, addr_buf)); ptr += ua->u.s.Length + ua->Address.iSockaddrLength; if (i < num_v4addrs - 1)