Skip to content

Commit 2874c38

Browse files
committed
Fix resolve action incorrectly overwriting UDP domain destination
1 parent fa60fd7 commit 2874c38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: route/route.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ match:
473473
}
474474
if !preMatch && inputPacketConn != nil && !metadata.Destination.IsFqdn() && !metadata.Destination.Addr.IsGlobalUnicast() {
475475
var timeout time.Duration
476-
if metadata.InboundType == C.TypeSOCKS {
476+
if metadata.InboundType == C.TypeSOCKS || metadata.InboundType == C.TypeMixed {
477477
timeout = C.TCPTimeout
478478
}
479479
newBuffer, newPacketBuffers, newErr := r.actionSniff(ctx, metadata, &rule.RuleActionSniff{Timeout: timeout}, inputConn, inputPacketConn)
@@ -572,7 +572,7 @@ func (r *Router) actionSniff(
572572
return
573573
}
574574
} else {
575-
if !metadata.Destination.Addr.IsGlobalUnicast() {
575+
if !metadata.Destination.IsFqdn() && !metadata.Destination.Addr.IsGlobalUnicast() {
576576
metadata.Destination = destination
577577
}
578578
if len(packetBuffers) > 0 {

0 commit comments

Comments
 (0)