From: Jason A. Donenfeld Date: Sat, 10 Apr 2021 00:08:48 +0000 (-0600) Subject: conn: windows: reset ring to starting position after free X-Git-Tag: 0.0.20210424~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f6bbe4ae8b2e46bcf71e9476fb29c30a9cb4d79;p=thirdparty%2Fwireguard-go.git conn: windows: reset ring to starting position after free Signed-off-by: Jason A. Donenfeld --- diff --git a/conn/bind_windows.go b/conn/bind_windows.go index a25c7aa..fdd1c24 100644 --- a/conn/bind_windows.go +++ b/conn/bind_windows.go @@ -197,6 +197,9 @@ func (ring *ringBuffer) CloseAndZero() { windows.VirtualFree(ring.packets, 0, windows.MEM_RELEASE) ring.packets = 0 } + ring.head = 0 + ring.tail = 0 + ring.isFull = false } func (bind *afWinRingBind) CloseAndZero() {