Fix: try to unmap lAddr on tproxy udp listener

This commit is contained in:
Dreamacro 2022-06-29 23:36:24 +08:00
parent c231fd1466
commit fc5c9b931b

View file

@ -72,6 +72,11 @@ func NewUDP(addr string, in chan<- *inbound.PacketAdapter) (*UDPListener, error)
if err != nil { if err != nil {
continue continue
} }
if rAddr.Addr().Is4() {
// try to unmap 4in6 address
lAddr = netip.AddrPortFrom(lAddr.Addr().Unmap(), lAddr.Port())
}
handlePacketConn(in, buf[:n], lAddr, rAddr) handlePacketConn(in, buf[:n], lAddr, rAddr)
} }
}() }()