Commit cf43c365 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

ws2_32: Re-add support for getting IP_HDRINCL on raw sockets.

This reverts most of commit e0013193. My previous diagnosis was incorrect: Windows does support both getting and setting IP_HDRINCL, but only on raw sockets. Very old versions of Windows also accept it on UDP sockets. Signed-off-by: 's avatarAlex Henrie <alexhenrie24@gmail.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 16955391
......@@ -1771,7 +1771,12 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
return do_setsockopt( handle, io, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, in_buffer, in_size );
#ifdef IP_HDRINCL
case IOCTL_AFD_WINE_GET_IP_HDRINCL:
if (get_sock_type( handle ) != SOCK_RAW) return STATUS_INVALID_PARAMETER;
return do_getsockopt( handle, io, IPPROTO_IP, IP_HDRINCL, out_buffer, out_size );
case IOCTL_AFD_WINE_SET_IP_HDRINCL:
if (get_sock_type( handle ) != SOCK_RAW) return STATUS_INVALID_PARAMETER;
return do_setsockopt( handle, io, IPPROTO_IP, IP_HDRINCL, in_buffer, in_size );
#endif
......
......@@ -1677,6 +1677,9 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
case IP_DONTFRAGMENT:
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_DONTFRAGMENT, optval, optlen );
case IP_HDRINCL:
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_HDRINCL, optval, optlen );
case IP_MULTICAST_IF:
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_MULTICAST_IF, optval, optlen );
......@@ -1701,10 +1704,6 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
case IP_UNICAST_IF:
return server_getsockopt( s, IOCTL_AFD_WINE_GET_IP_UNICAST_IF, optval, optlen );
case IP_HDRINCL:
SetLastError( WSAEINVAL );
return -1;
default:
FIXME( "unrecognized IP option %u\n", optname );
/* fall through */
......
......@@ -187,6 +187,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_SET_IP_DONTFRAGMENT WINE_AFD_IOC(243)
#define IOCTL_AFD_WINE_SET_IP_DROP_MEMBERSHIP WINE_AFD_IOC(244)
#define IOCTL_AFD_WINE_SET_IP_DROP_SOURCE_MEMBERSHIP WINE_AFD_IOC(245)
#define IOCTL_AFD_WINE_GET_IP_HDRINCL WINE_AFD_IOC(246)
#define IOCTL_AFD_WINE_SET_IP_HDRINCL WINE_AFD_IOC(247)
#define IOCTL_AFD_WINE_GET_IP_MULTICAST_IF WINE_AFD_IOC(248)
#define IOCTL_AFD_WINE_SET_IP_MULTICAST_IF WINE_AFD_IOC(249)
......
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