From defe743b23a6581433fc3d0d198c8e7b977e2cac Mon Sep 17 00:00:00 2001 From: xqzr <34030394+xqzr@users.noreply.github.com> Date: Wed, 23 Jul 2025 20:06:40 +0800 Subject: [PATCH] re Update bind.go --- proxy/wireguard/bind.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/wireguard/bind.go b/proxy/wireguard/bind.go index 808d1094..79de7eba 100644 --- a/proxy/wireguard/bind.go +++ b/proxy/wireguard/bind.go @@ -230,9 +230,11 @@ func (e netEndpoint) SrcIP() netip.Addr { } func (e netEndpoint) DstToBytes() []byte { - var dat []byte = e.dst.Address.IP().To16()[:] + var dat []byte if e.dst.Address.Family().IsIPv4() { dat = e.dst.Address.IP().To4()[:] + } else { + dat = e.dst.Address.IP().To16()[:] } dat = append(dat, byte(e.dst.Port), byte(e.dst.Port>>8)) return dat