diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 42bab60a841..01ebd7cf5b9 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4698,16 +4698,18 @@ int WINAPI WSARemoveServiceClass(LPGUID info) PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, size_t len ) { #ifdef HAVE_INET_NTOP - union generic_unix_sockaddr unix_addr; + struct WS_in6_addr *in6; + struct WS_in_addr *in; + TRACE("family %d, addr (%p), buffer (%p), len %d\n", family, addr, buffer, len); switch (family) { case WS_AF_INET: - ws_sockaddr_ws2u( addr, sizeof(struct WS_sockaddr_in), &unix_addr ); - return inet_ntop( AF_INET, &unix_addr, buffer, len ); + in = addr; + return inet_ntop( AF_INET, &in->WS_s_addr, buffer, len ); case WS_AF_INET6: - ws_sockaddr_ws2u( addr, sizeof(struct WS_sockaddr_in6), &unix_addr ); - return inet_ntop( AF_INET6, &unix_addr, buffer, len ); + in6 = addr; + return inet_ntop( AF_INET6, in6->WS_s6_addr, buffer, len ); } #else FIXME( "not supported on this platform\n" ); diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 7bc3ee89040..8316982da66 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2040,7 +2040,7 @@ static void test_addr_to_print(void) pdst = pInetNtop(AF_INET,(void*)&in.s_addr, dst, sizeof(dst)); ok(pdst != NULL, "InetNtop failed %s\n", dst); - todo_wine ok(!strcmp(pdst, addr1_Str),"Address %s != %s\n", pdst, addr1_Str); + ok(!strcmp(pdst, addr1_Str),"Address %s != %s\n", pdst, addr1_Str); /* Test invalid parm conditions */ pdst = pInetNtop(1, (void*)&in.s_addr, dst, sizeof(dst)); @@ -2051,13 +2051,13 @@ static void test_addr_to_print(void) memcpy(in6.u.Byte, addr2_Num, sizeof(addr2_Num)); pdst = pInetNtop(AF_INET6,(void*)&in6.s6_addr, dst6, sizeof(dst6)); ok(pdst != NULL, "InetNtop failed %s\n", dst6); - todo_wine ok(!strcmp(pdst, addr2_Str),"Address %s != %s\n", pdst, addr2_Str); + ok(!strcmp(pdst, addr2_Str),"Address %s != %s\n", pdst, addr2_Str); /* Test an zero suffixed IPV6 address */ memcpy(in6.s6_addr, addr3_Num, sizeof(addr3_Num)); pdst = pInetNtop(AF_INET6,(void*)&in6.s6_addr, dst6, sizeof(dst6)); ok(pdst != NULL, "InetNtop failed %s\n", dst6); - todo_wine ok(!strcmp(pdst, addr3_Str),"Address %s != %s\n", pdst, addr3_Str); + ok(!strcmp(pdst, addr3_Str),"Address %s != %s\n", pdst, addr3_Str); } static void test_ioctlsocket(void)