From 548ce5c3a2a097a2279825decc0ed61656a3c116 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Tue, 22 Nov 2022 16:32:15 -0500 Subject: [PATCH] invert packet direction on WINDIVERT_ADDRESS We simply keep the WINDIVERT_ADDRESS struct given on recv, so when using it for send we need to invert the direction (the Output bit) --- llarp/win32/windivert.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llarp/win32/windivert.cpp b/llarp/win32/windivert.cpp index 6f8a3aa58..d2dadc01a 100644 --- a/llarp/win32/windivert.cpp +++ b/llarp/win32/windivert.cpp @@ -206,6 +206,8 @@ namespace llarp::win32 auto& pkt = w_pkt.pkt; auto* addr = &w_pkt.addr; + addr->Outbound = !addr->Outbound; // re-used from recv, so invert direction + log::trace(logcat, "send dns packet of size {}B", pkt.size()); log_windivert_addr(w_pkt.addr);