aboutsummaryrefslogtreecommitdiffstats
path: root/driver/socket.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-09-20 18:43:00 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2021-09-20 18:44:34 +0000
commit08a3e986009e243e787d28cebce7316aebdf9211 (patch)
treec4c22b6778f63a1f0012419cb92878f81afe64da /driver/socket.c
parentdriver: remove _NO_CRT_STDIO_INLINE workaround (diff)
downloadwireguard-nt-08a3e986009e243e787d28cebce7316aebdf9211.tar.xz
wireguard-nt-08a3e986009e243e787d28cebce7316aebdf9211.zip
driver: socket: do not use zero UDPv4 checksums
Some routers using hardware NAT can't handle this. A packet goes through initially, but then once the flow is established and it's offloaded to the NAT hardware, the zero checksum causes most packets to be dropped. So, unfortunately, we have to remove this optimization. Reported-by: Christian Ã…rebrand <myspysgaddan@hotmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'driver/socket.c')
-rw-r--r--driver/socket.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/driver/socket.c b/driver/socket.c
index 466daac..2a56196 100644
--- a/driver/socket.c
+++ b/driver/socket.c
@@ -23,10 +23,6 @@
#include "logging.h"
#include <wsk.h>
#include <netioapi.h>
-/* The headers say that UDP_NOCHECKSUM is defined in ws2tcpip.h for hysterical raisins,
- * which we can't include from kernel space.
- */
-#define UDP_NOCHECKSUM 1
static LONG RoutingGenerationV4 = 1, RoutingGenerationV6 = 1;
static HANDLE RouteNotifierV4, RouteNotifierV6;
@@ -783,9 +779,6 @@ CreateAndBindSocket(_In_ WG_DEVICE *Wg, _Inout_ SOCKADDR *Sa, _Out_ SOCKET **Ret
ULONG True = TRUE;
if (Sa->sa_family == AF_INET)
{
- Status = SetSockOpt(Sock, IPPROTO_UDP, UDP_NOCHECKSUM, &True, sizeof(True));
- if (!NT_SUCCESS(Status))
- goto cleanupSocket;
Status = SetSockOpt(Sock, IPPROTO_IP, IP_PKTINFO, &True, sizeof(True));
if (!NT_SUCCESS(Status))
goto cleanupSocket;