forked from Mirrors/wine-wine
ws2_32: Reimplement inet_ntop on top of ntdll functions.
And add a couple of tests for IPv6 addresses that Windows represents using dot-decimal notation for the last 32 bits but GNU/Linux does not. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>feature/deterministic
parent
0af08318b7
commit
a294f755ce
|
@ -18296,9 +18296,6 @@ for ac_func in \
|
||||||
getprotobyname \
|
getprotobyname \
|
||||||
getprotobynumber \
|
getprotobynumber \
|
||||||
getservbyport \
|
getservbyport \
|
||||||
inet_addr \
|
|
||||||
inet_network \
|
|
||||||
inet_ntop \
|
|
||||||
|
|
||||||
do :
|
do :
|
||||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
|
|
|
@ -2249,9 +2249,6 @@ AC_CHECK_FUNCS(\
|
||||||
getprotobyname \
|
getprotobyname \
|
||||||
getprotobynumber \
|
getprotobynumber \
|
||||||
getservbyport \
|
getservbyport \
|
||||||
inet_addr \
|
|
||||||
inet_network \
|
|
||||||
inet_ntop \
|
|
||||||
)
|
)
|
||||||
|
|
||||||
dnl Check for clock_gettime which may be in -lrt
|
dnl Check for clock_gettime which may be in -lrt
|
||||||
|
|
|
@ -8351,10 +8351,8 @@ int WINAPI WSARemoveServiceClass(LPGUID info)
|
||||||
*/
|
*/
|
||||||
PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, SIZE_T len )
|
PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, SIZE_T len )
|
||||||
{
|
{
|
||||||
#ifdef HAVE_INET_NTOP
|
NTSTATUS status;
|
||||||
struct WS_in6_addr *in6;
|
ULONG size = min( len, (ULONG)-1 );
|
||||||
struct WS_in_addr *in;
|
|
||||||
PCSTR pdst;
|
|
||||||
|
|
||||||
TRACE("family %d, addr (%p), buffer (%p), len %ld\n", family, addr, buffer, len);
|
TRACE("family %d, addr (%p), buffer (%p), len %ld\n", family, addr, buffer, len);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
|
@ -8367,14 +8365,12 @@ PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, SIZE_T len )
|
||||||
{
|
{
|
||||||
case WS_AF_INET:
|
case WS_AF_INET:
|
||||||
{
|
{
|
||||||
in = addr;
|
status = RtlIpv4AddressToStringExA( (IN_ADDR *)addr, 0, buffer, &size );
|
||||||
pdst = inet_ntop( AF_INET, &in->WS_s_addr, buffer, len );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WS_AF_INET6:
|
case WS_AF_INET6:
|
||||||
{
|
{
|
||||||
in6 = addr;
|
status = RtlIpv6AddressToStringExA( (IN6_ADDR *)addr, 0, 0, buffer, &size );
|
||||||
pdst = inet_ntop( AF_INET6, in6->WS_s6_addr, buffer, len );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -8382,13 +8378,9 @@ PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, SIZE_T len )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pdst) SetLastError( STATUS_INVALID_PARAMETER );
|
if (status == STATUS_SUCCESS) return buffer;
|
||||||
return pdst;
|
SetLastError( STATUS_INVALID_PARAMETER );
|
||||||
#else
|
|
||||||
FIXME( "not supported on this platform\n" );
|
|
||||||
SetLastError( WSAEAFNOSUPPORT );
|
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -5008,6 +5008,12 @@ static void test_inet_pton(void)
|
||||||
"0x12345678", NULL, NULL},
|
"0x12345678", NULL, NULL},
|
||||||
{AF_INET6, 0, 0, /* windows bug */
|
{AF_INET6, 0, 0, /* windows bug */
|
||||||
"::1:2:3:4:5:6:7", NULL, NULL},
|
"::1:2:3:4:5:6:7", NULL, NULL},
|
||||||
|
{AF_INET6, 1, 0, /* Test 30 */
|
||||||
|
"::5efe:1.2.3.4", "::5efe:1.2.3.4",
|
||||||
|
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\xfe\x01\x02\x03\x04"},
|
||||||
|
{AF_INET6, 1, 0,
|
||||||
|
"::ffff:0:1.2.3.4", "::ffff:0:1.2.3.4",
|
||||||
|
"\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x01\x02\x03\x04"},
|
||||||
};
|
};
|
||||||
int i, ret;
|
int i, ret;
|
||||||
DWORD err;
|
DWORD err;
|
||||||
|
|
|
@ -296,18 +296,9 @@
|
||||||
/* Define to 1 if you have the `ilogbf' function. */
|
/* Define to 1 if you have the `ilogbf' function. */
|
||||||
#undef HAVE_ILOGBF
|
#undef HAVE_ILOGBF
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_addr' function. */
|
|
||||||
#undef HAVE_INET_ADDR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inet/mib2.h> header file. */
|
/* Define to 1 if you have the <inet/mib2.h> header file. */
|
||||||
#undef HAVE_INET_MIB2_H
|
#undef HAVE_INET_MIB2_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_network' function. */
|
|
||||||
#undef HAVE_INET_NETWORK
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_ntop' function. */
|
|
||||||
#undef HAVE_INET_NTOP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#undef HAVE_INTTYPES_H
|
#undef HAVE_INTTYPES_H
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue