Skip to content

Commit

Permalink
Fix resolve action incorrectly overwriting UDP domain destination
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Dec 28, 2024
1 parent fa60fd7 commit 2874c38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2874c38

Please sign in to comment.