]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
conn: windows: reset ring to starting position after free
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 10 Apr 2021 00:08:48 +0000 (18:08 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 10 Apr 2021 00:09:41 +0000 (18:09 -0600)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
conn/bind_windows.go

index a25c7aa2710ac04ad7dacf4215082cc709a1c7b5..fdd1c242474432ab0dd949f90b461eaeac9ee14d 100644 (file)
@@ -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() {