Commit 9561ba33 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

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: '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 13650f43
......@@ -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 */
......
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