summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-04-09 18:08:48 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-09 18:09:41 -0600
commit5f6bbe4ae8b2e46bcf71e9476fb29c30a9cb4d79 (patch)
treedd70317f3658cadd3fea63926160c8de872de1e3
parent75526d60714ce2e2e967830b42422788fb1b7498 (diff)
conn: windows: reset ring to starting position after free
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--conn/bind_windows.go3
1 files changed, 3 insertions, 0 deletions
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() {