From 4c8ee0af50bbabd29e6766f0d9509add6fc0b2e7 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Fri, 3 Mar 2023 15:39:16 +0000 Subject: [PATCH] Set reserved to zero after Read() Thank @IRN-Kawakaze for testing --- proxy/wireguard/bind.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proxy/wireguard/bind.go b/proxy/wireguard/bind.go index a90a9703..527f0e74 100644 --- a/proxy/wireguard/bind.go +++ b/proxy/wireguard/bind.go @@ -129,6 +129,13 @@ func (bind *netBindClient) connectTo(endpoint *netEndpoint) error { return } i, err := c.Read(v.buff) + + if i > 3 { + v.buff[1] = 0 + v.buff[2] = 0 + v.buff[3] = 0 + } + v.bytes = i v.endpoint = endpoint v.err = err