Commit Graph

101 Commits

Author SHA1 Message Date
Alexandre Julliard e5d69d9ee6 configure: Assume that sys/ioctl.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard a7ac3de3b3 configure: Assume that sys/socket.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard ea2c743668 configure: Define _GNU_SOURCE in config.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 11:22:53 +02:00
Alex Henrie f45bc4f238 ws2_32: Hook up IP_RECVTOS.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:12 +02:00
Alex Henrie 0853573caf ws2_32: Hook up IP_RECVTTL.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:12 +02:00
Alex Henrie 9561ba33cd 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>
2021-09-27 20:39:15 +02:00
Guillaume Charifi 5990f19bdc ntdll: Implement exclusive flag for IOCTL_AFD_POLL.
Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:16 +02:00
Guillaume Charifi a215324c6b ws2_32: Add tests for IOCTL_AFD_POLL exclusive flag.
Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:27:25 +02:00
Zebediah Figura 4f4fee53a6 ntdll: Return STATUS_DEVICE_NOT_READY instead of STATUS_PENDING from try_transmit().
async_transmit_proc() expects the former.

Fixes: 1eb56b20ba
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:27:15 +02:00
Zebediah Figura 1eb56b20ba ntdll: Explicitly return whether an async is complete in async_callback_t.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:31:20 +02:00
Zebediah Figura 1ee382c706 server: Pass the async result size as part of apc_call_t.
Only really an optimization (plus it makes the code a little conceptually simpler).

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:30:09 +02:00
Alex Henrie cf43c365ce ws2_32: Re-add support for getting IP_HDRINCL on raw sockets.
This reverts most of commit e001319304.

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: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:08:01 +02:00
Alex Henrie 169553916e ntdll: Check for unsupported socket protocol+option combinations.
Windows supports none of these options on TCP. Linux supports all of
them on TCP. Mac OS supports some of them on TCP, but sets EOPNOTSUPP
instead of EINVAL for the ones that it doesn't support. So, Wine needs
to do its own check for whether the option may be used with the socket.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:07:59 +02:00
Alex Henrie e001319304 ws2_32: Drop support for getting the IP_HDRINCL socket option.
Windows only supports setting this option, not getting it.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 20:02:23 +02:00
Alex Henrie f68923dca0 ws2_32: Hook up IPV6_RECVTCLASS.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-16 18:40:29 +02:00
Alex Henrie 21752cc956 ntdll: Add missing break to case IPV6_PKTINFO.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-06 10:40:35 +02:00
Alexandre Julliard 156c34ea03 ntdll: Add a helper function to get the iosb pointer to pass to the server.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 20:43:28 +02:00
Alexandre Julliard 460755a007 ntdll: Avoid some duplicate async definitions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 20:43:28 +02:00
Alex Henrie cade5944be ws2_32: Hook up IPV6_PKTINFO.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 23:20:40 +02:00
Alex Henrie 71d1bb60f1 ws2_32: Hook up IPV6_HOPLIMIT.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 22:06:11 +02:00
Gabriel Ivăncescu 26724c3ef4 ntdll: Fix offsetof syntax for IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Zebediah Figura 8c47f02cb5 ws2_32: Move the setsockopt(TCP_NODELAY) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 11:32:18 +02:00
Zebediah Figura b1669e3a4c ws2_32: Move the getsockopt(TCP_NODELAY) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 11:32:15 +02:00
Zebediah Figura 3e09e25068 ws2_32: Move the getsockopt(IRLMP_ENUMDEVICES) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 11:32:12 +02:00
Zebediah Figura 55c761540d ws2_32: Move the setsockopt(IPX_PTYPE) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 11:32:10 +02:00
Zebediah Figura ce1c5ffcae ws2_32: Move the getsockopt(IPX_PTYPE) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-02 11:32:07 +02:00
Zebediah Figura bf633a97a0 ws2_32: Move the setsockopt(IPV6_V6ONLY) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 13:46:15 +02:00
Zebediah Figura 43dfa9d437 ws2_32: Move the getsockopt(IPV6_V6ONLY) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 13:46:11 +02:00
Zebediah Figura 81ba59bb21 ws2_32: Move the setsockopt(IPV6_UNICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 13:46:08 +02:00
Zebediah Figura a6b880a042 ws2_32: Move the getsockopt(IPV6_UNICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 13:46:04 +02:00
Zebediah Figura 717766e58f ws2_32: Move the setsockopt(IPV6_UNICAST_HOPS) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 13:45:58 +02:00
Zebediah Figura 40adc6a295 ws2_32: Move the getsockopt(IPV6_UNICAST_HOPS) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 13:45:55 +02:00
Zebediah Figura 15bc605224 ws2_32: Move the setsockopt(IPV6_MULTICAST_LOOP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 10:16:21 +02:00
Zebediah Figura aab6e604a9 ws2_32: Move the getsockopt(IPV6_MULTICAST_LOOP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 10:16:19 +02:00
Zebediah Figura a3f3ecf126 ws2_32: Move the setsockopt(IPV6_MULTICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 10:16:17 +02:00
Zebediah Figura 15b3ab9b5b ws2_32: Move the getsockopt(IPV6_MULTICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 10:16:13 +02:00
Zebediah Figura 6760eea1f0 ws2_32: Move the setsockopt(IPV6_MULTICAST_HOPS) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 10:16:10 +02:00
Zebediah Figura 5dffe2263d ws2_32: Move the getsockopt(IPV6_MULTICAST_HOPS) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Zebediah Figura 6d2fb6f135 ws2_32: Move the setsockopt(IPV6_DROP_MEMBERSHIP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Zebediah Figura e1a34ce063 ws2_32: Move the setsockopt(IPV6_DONTFRAG) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Zebediah Figura a615e67792 ws2_32: Move the getsockopt(IPV6_DONTFRAG) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Zebediah Figura ef54a8c318 ws2_32: Move the setsockopt(IPV6_ADD_MEMBERSHIP) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Zebediah Figura a06bcd03b9 ws2_32: Move the setsockopt(IP_UNICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-27 10:58:40 +02:00
Zebediah Figura 5819c52f3a ws2_32: Move the getsockopt(IP_UNICAST_IF) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-27 10:58:38 +02:00
Zebediah Figura 9715bd258c ws2_32: Move the setsockopt(IP_UNBLOCK_SOURCE) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-27 10:58:34 +02:00
Zebediah Figura bcf777fd18 ws2_32: Move the setsockopt(IP_TTL) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-27 10:58:30 +02:00
Zebediah Figura 86e521d5bb ntdll: Fill the I/O status block with the results of the recv_socket call in sock_recv().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-26 20:14:20 +02:00
Zebediah Figura 4c639d6926 ntdll: Fill the I/O status block with the results of the send_socket call in sock_send().
The server might change the status. In particular, if we got a short but nonzero
write on a nonblocking socket, try_send() would return STATUS_DEVICE_NOT_READY
and hence leave the I/O status block unfilled. The server subsequently massages
this into STATUS_SUCECSS, causing a garbage size to be eventually returned from
ws2_32 send().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51439
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-26 20:14:18 +02:00
Zebediah Figura 6f3e5090ee ntdll: Do not accept sizeof(struct WS_sockaddr_in6_old).
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-23 19:03:19 +02:00
Zebediah Figura 7986d4e299 ws2_32: Move the getsockopt(IP_TTL) implementation to ntdll.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-10 15:38:42 +02:00