Fix resolve action incorrectly overwriting UDP domain destination

This commit is contained in:
世界 2024-12-28 15:05:05 +08:00
parent d9d0a2373a
commit ce0fcd5c8b
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -473,7 +473,7 @@ match:
}
if !preMatch && inputPacketConn != nil && !metadata.Destination.IsFqdn() && !metadata.Destination.Addr.IsGlobalUnicast() {
var timeout time.Duration
if metadata.InboundType == C.TypeSOCKS {
if metadata.InboundType == C.TypeSOCKS || metadata.InboundType == C.TypeMixed {
timeout = C.TCPTimeout
}
newBuffer, newPacketBuffers, newErr := r.actionSniff(ctx, metadata, &rule.RuleActionSniff{Timeout: timeout}, inputConn, inputPacketConn)
@ -572,7 +572,7 @@ func (r *Router) actionSniff(
return
}
} else {
if !metadata.Destination.Addr.IsGlobalUnicast() {
if !metadata.Destination.IsFqdn() && !metadata.Destination.Addr.IsGlobalUnicast() {
metadata.Destination = destination
}
if len(packetBuffers) > 0 {