ws2_32: Manage shorter length for IPV6_V6ONLY.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ed09d9a4c0
commit
081ba0ee2f
|
@ -1890,6 +1890,12 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
|
|||
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_UNICAST_IF, optval, optlen );
|
||||
|
||||
case IPV6_V6ONLY:
|
||||
if (*optlen < 1 || !optval)
|
||||
{
|
||||
SetLastError( WSAEFAULT );
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
*optlen = 1;
|
||||
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IPV6_V6ONLY, optval, optlen );
|
||||
|
||||
default:
|
||||
|
@ -3277,7 +3283,13 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int
|
|||
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_UNICAST_IF, optval, optlen );
|
||||
|
||||
case IPV6_V6ONLY:
|
||||
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_V6ONLY, optval, optlen );
|
||||
if (!optlen || !optval)
|
||||
{
|
||||
SetLastError( WSAEFAULT );
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
value = *optval;
|
||||
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IPV6_V6ONLY, (char *)&value, sizeof(value) );
|
||||
|
||||
default:
|
||||
FIXME("Unknown IPPROTO_IPV6 optname 0x%08x\n", optname);
|
||||
|
|
|
@ -1196,6 +1196,7 @@ static void test_set_getsockopt(void)
|
|||
{AF_INET6, SOCK_DGRAM, IPPROTO_IPV6, IPV6_PKTINFO, FALSE, {0, 0, 4}, {0}, TRUE, TRUE},
|
||||
{AF_INET6, SOCK_DGRAM, IPPROTO_IPV6, IPV6_RECVTCLASS, FALSE, {0, 0, 4}, {0}, TRUE, TRUE},
|
||||
{AF_INET6, SOCK_DGRAM, IPPROTO_IPV6, IPV6_UNICAST_HOPS, TRUE, {1, 1, 4}, {0}, FALSE},
|
||||
{AF_INET6, SOCK_DGRAM, IPPROTO_IPV6, IPV6_V6ONLY, TRUE, {1, 1, 1}, {0}, TRUE},
|
||||
};
|
||||
SOCKET s, s2;
|
||||
int i, j, err, lasterr;
|
||||
|
|
Loading…
Reference in New Issue