From 5f6bbe4ae8b2e46bcf71e9476fb29c30a9cb4d79 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 9 Apr 2021 18:08:48 -0600 Subject: conn: windows: reset ring to starting position after free Signed-off-by: Jason A. Donenfeld --- conn/bind_windows.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'conn') 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() { -- cgit v1.2.3-59-g8ed1b