public inbox for wireguard@lists.zx2c4.com
 help / color / mirror / Atom feed
From: odedkatz <katz.oded@gmail.com>
To: wireguard@lists.zx2c4.com
Cc: odedk@twingate.com, alexey@twingate.com, odedkatz <katz.oded@gmail.com>
Subject: [PATCH 1/1] remove the condition on possibly stale variable (Session->Descriptor.Receive.Ring->Alertable) for Setting TailMoved event
Date: Tue, 24 Feb 2026 15:42:46 -0800	[thread overview]
Message-ID: <20260224234246.16021-2-katz.oded@gmail.com> (raw)
In-Reply-To: <20260224234246.16021-1-katz.oded@gmail.com>

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


      reply	other threads:[~2026-02-24 23:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 23:42 [PATCH 0/1] wintun driver get stalled for few sec until another packet is being sent -- approach 1 odedkatz
2026-02-24 23:42 ` odedkatz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260224234246.16021-2-katz.oded@gmail.com \
    --to=katz.oded@gmail.com \
    --cc=alexey@twingate.com \
    --cc=odedk@twingate.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox