From ce0fcd5c8b8eec83acad60db2bda2d0c3b6d22aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 28 Dec 2024 15:05:05 +0800 Subject: [PATCH] Fix resolve action incorrectly overwriting UDP domain destination --- route/route.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/route/route.go b/route/route.go index ca747462..624b2289 100644 --- a/route/route.go +++ b/route/route.go @@ -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 {