fix(tproxy): inbound.ApplyAdditions high cpu usage

This commit is contained in:
Indexyz 2025-04-03 15:48:36 +08:00
parent 7b37fcfc8d
commit f63df4bdce

View file

@ -81,13 +81,12 @@ func NewUDP(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*UDPLi
}
dscp, _ := getDSCP(oob[:oobn])
additions = append(additions, inbound.WithDSCP(dscp))
if rAddr.Addr().Is4() {
// try to unmap 4in6 address
lAddr = netip.AddrPortFrom(lAddr.Addr().Unmap(), lAddr.Port())
}
handlePacketConn(l, tunnel, buf[:n], lAddr, rAddr, additions...)
handlePacketConn(l, tunnel, buf[:n], lAddr, rAddr, append(additions, inbound.WithDSCP(dscp))...)
}
}()