diff --git a/proxy/wireguard/bind.go b/proxy/wireguard/bind.go index 79de7eba..808d1094 100644 --- a/proxy/wireguard/bind.go +++ b/proxy/wireguard/bind.go @@ -230,11 +230,9 @@ func (e netEndpoint) SrcIP() netip.Addr { } func (e netEndpoint) DstToBytes() []byte { - var dat []byte + var dat []byte = e.dst.Address.IP().To16()[:] 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