From 3ae726d9f02b4f71663973b1bdb5d73ab6d05a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 3 Oct 2023 11:50:00 +0800 Subject: [PATCH] Fix gVisor UDP 6to4 check --- stack_gvisor_udp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack_gvisor_udp.go b/stack_gvisor_udp.go index ce4648b..ca5856a 100644 --- a/stack_gvisor_udp.go +++ b/stack_gvisor_udp.go @@ -90,7 +90,7 @@ func (w *UDPBackWriter) WritePacket(packetBuffer *buf.Buffer, destination M.Sock return E.Cause(os.ErrInvalid, "invalid destination") } else if destination.IsIPv4() && w.sourceNetwork == header.IPv6ProtocolNumber { destination = M.SocksaddrFrom(netip.AddrFrom16(destination.Addr.As16()), destination.Port) - } else if destination.IsIPv6() && (w.sourceNetwork == header.IPv4AddressSizeBits) { + } else if destination.IsIPv6() && (w.sourceNetwork == header.IPv4ProtocolNumber) { return E.New("send IPv6 packet to IPv4 connection") }