Commit f95fd91f authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ws2_32: Manage shorter length for IP_RECVTOS.

parent d4595a9a
...@@ -1770,6 +1770,12 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl ...@@ -1770,6 +1770,12 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_PKTINFO, optval, optlen ); return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_PKTINFO, optval, optlen );
case IP_RECVTOS: case IP_RECVTOS:
if (*optlen < sizeof(DWORD) || !optval)
{
*optlen = 0;
SetLastError( WSAEFAULT );
return SOCKET_ERROR;
}
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_RECVTOS, optval, optlen ); return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_RECVTOS, optval, optlen );
case IP_RECVTTL: case IP_RECVTTL:
...@@ -3086,6 +3092,11 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int ...@@ -3086,6 +3092,11 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_PKTINFO, optval, optlen ); return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_PKTINFO, optval, optlen );
case IP_RECVTOS: case IP_RECVTOS:
if (optlen < sizeof(DWORD) || !optval)
{
SetLastError( WSAEFAULT );
return SOCKET_ERROR;
}
return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_RECVTOS, optval, optlen ); return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_RECVTOS, optval, optlen );
case IP_RECVTTL: case IP_RECVTTL:
......
...@@ -1185,6 +1185,7 @@ static void test_set_getsockopt(void) ...@@ -1185,6 +1185,7 @@ static void test_set_getsockopt(void)
{AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_MULTICAST_LOOP, TRUE, {1, 1, 4}, {0}, TRUE, TRUE}, {AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_MULTICAST_LOOP, TRUE, {1, 1, 4}, {0}, TRUE, TRUE},
{AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_MULTICAST_TTL, TRUE, {1, 1, 4}, {0}, FALSE}, {AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_MULTICAST_TTL, TRUE, {1, 1, 4}, {0}, FALSE},
{AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_PKTINFO, FALSE, {0, 0, 4}, {0}, TRUE, TRUE}, {AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_PKTINFO, FALSE, {0, 0, 4}, {0}, TRUE, TRUE},
{AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_RECVTOS, FALSE, {0, 0, 4}, {0}, TRUE, TRUE},
{AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_TOS, TRUE, {1, 1, 4}, {0}, FALSE}, {AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_TOS, TRUE, {1, 1, 4}, {0}, FALSE},
{AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_TTL, TRUE, {1, 1, 4}, {0}, FALSE}, {AF_INET, SOCK_DGRAM, IPPROTO_IP, IP_TTL, TRUE, {1, 1, 4}, {0}, FALSE},
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment