conn: windows: reset ring to starting position after free

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-04-09 18:08:48 -06:00
parent 75526d6071
commit 5f6bbe4ae8

View file

@ -197,6 +197,9 @@ func (ring *ringBuffer) CloseAndZero() {
windows.VirtualFree(ring.packets, 0, windows.MEM_RELEASE) windows.VirtualFree(ring.packets, 0, windows.MEM_RELEASE)
ring.packets = 0 ring.packets = 0
} }
ring.head = 0
ring.tail = 0
ring.isFull = false
} }
func (bind *afWinRingBind) CloseAndZero() { func (bind *afWinRingBind) CloseAndZero() {