ws2_32: Remove outer preprocessor checks from control message functions.

The checks were ugly and unnecessary. Furthermore, these functions are
used for both IPv4 and IPv6 options, and it's conceivable that a system
could be stripped down to only provide IPv6 support and not IPv4
support.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2021-09-27 08:40:22 -06:00 committed by Alexandre Julliard
parent 13650f43c9
commit 9561ba33cd
1 changed files with 0 additions and 7 deletions

View File

@ -369,7 +369,6 @@ static int sockaddr_from_unix( const union unix_sockaddr *uaddr, struct WS_socka
}
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
#if defined(IP_PKTINFO) || defined(IP_RECVDSTADDR)
static WSACMSGHDR *fill_control_message( int level, int type, WSACMSGHDR *current, ULONG *maxsize, void *data, int len )
{
ULONG msgsize = sizeof(WSACMSGHDR) + WSA_CMSG_ALIGN(len);
@ -384,11 +383,9 @@ static WSACMSGHDR *fill_control_message( int level, int type, WSACMSGHDR *curren
memcpy(ptr, data, len);
return (WSACMSGHDR *)(ptr + WSA_CMSG_ALIGN(len));
}
#endif /* defined(IP_PKTINFO) || defined(IP_RECVDSTADDR) */
static int convert_control_headers(struct msghdr *hdr, WSABUF *control)
{
#if defined(IP_PKTINFO) || defined(IP_RECVDSTADDR)
WSACMSGHDR *cmsg_win = (WSACMSGHDR *)control->buf, *ptr;
ULONG ctlsize = control->len;
struct cmsghdr *cmsg_unix;
@ -490,10 +487,6 @@ static int convert_control_headers(struct msghdr *hdr, WSABUF *control)
error:
control->len = 0;
return 0;
#else /* defined(IP_PKTINFO) || defined(IP_RECVDSTADDR) */
control->len = 0;
return 1;
#endif /* defined(IP_PKTINFO) || defined(IP_RECVDSTADDR) */
}
#endif /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */