From: Jason A. Donenfeld Date: Tue, 11 May 2021 14:47:17 +0000 (+0200) Subject: conn: windows: set count=0 on retry X-Git-Tag: 0.0.20211016~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5846b622837e04dbc35b153d9ceda7fd66397520;p=thirdparty%2Fwireguard-go.git conn: windows: set count=0 on retry When retrying, if count is not 0, we forget to dequeue another request, and so the ring fills up and errors out. Reported-by: Sascha Dierberg Signed-off-by: Jason A. Donenfeld --- diff --git a/conn/bind_windows.go b/conn/bind_windows.go index 42208b1..d744987 100644 --- a/conn/bind_windows.go +++ b/conn/bind_windows.go @@ -357,6 +357,7 @@ func (bind *afWinRingBind) Receive(buf []byte, isOpen *uint32) (int, Endpoint, e var count uint32 var results [1]winrio.Result retry: + count = 0 for tries := 0; count == 0 && tries < receiveSpins; tries++ { if tries > 0 { if atomic.LoadUint32(isOpen) != 1 {