From 19441f5e4db24a2e9db4eec93c94599e84f801d7 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Wed, 29 Jun 2022 23:36:24 +0800 Subject: [PATCH] Fix: try to unmap lAddr on tproxy udp listener --- listener/tproxy/udp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/listener/tproxy/udp.go b/listener/tproxy/udp.go index 60783563..0e7c059f 100644 --- a/listener/tproxy/udp.go +++ b/listener/tproxy/udp.go @@ -72,6 +72,11 @@ func NewUDP(addr string, in chan<- *inbound.PacketAdapter) (*UDPListener, error) if err != nil { continue } + + if rAddr.Addr().Is4() { + // try to unmap 4in6 address + lAddr = netip.AddrPortFrom(lAddr.Addr().Unmap(), lAddr.Port()) + } handlePacketConn(in, buf[:n], lAddr, rAddr) } }()