[PATCH 1/1] remove the condition on possibly stale variable (Session->Descriptor.Receive.Ring->Alertable) for Setting TailMoved event

odedkatz <[email protected]> Tue, 24 Feb 2026 15:42:46 -0800
Newsgroups com.zx2c4.lists.wireguard
Message-ID <[email protected]>
otherwise wintun driver just holds on the event until something wakes it up (see here)[https://github.com/Twingate/wintun/blob/6bfc34a60aa944149fdc7e9cddb191e9a8b6ec1a/driver/twintun.c#L487-L488]
---
 api/session.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/api/session.c b/api/session.c
index ab96c64..dcaeb25 100644
--- a/api/session.c
+++ b/api/session.c
@@ -302,8 +302,7 @@ WintunSendPacket(TUN_SESSION *Session, const BYTE *Packet)
     if (Session->Descriptor.Receive.Ring->Tail != Session->Receive.TailRelease)
     {
         WriteULongRelease(&Session->Descriptor.Receive.Ring->Tail, Session->Receive.TailRelease);
-        if (ReadAcquire(&Session->Descriptor.Receive.Ring->Alertable))
-            SetEvent(Session->Descriptor.Receive.TailMoved);
+        SetEvent(Session->Descriptor.Receive.TailMoved);
     }
     LeaveCriticalSection(&Session->Receive.Lock);
 }
-- 
2.43.0