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:
parent
13650f43c9
commit
9561ba33cd
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in New Issue