From 2054998cecc5b8d2b6a087d98abdb6ebcb4137ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 23 Oct 2026 14:30:10 +0800 Subject: [PATCH] Follow resolved address order in parallel dial --- common/dialer/resolve.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/dialer/resolve.go b/common/dialer/resolve.go index 21fe38d5..8fa48f6b 100644 --- a/common/dialer/resolve.go +++ b/common/dialer/resolve.go @@ -105,7 +105,7 @@ func (d *resolveDialer) DialContext(ctx context.Context, network string, destina return nil, err } if d.parallel { - return N.DialParallel(ctx, d.dialer, network, destination, addresses, d.queryOptions.Strategy == C.DomainStrategyPreferIPv6, d.fallbackDelay) + return N.DialParallel(ctx, d.dialer, network, destination, addresses, addresses[0].Is6(), d.fallbackDelay) } else { return N.DialSerial(ctx, d.dialer, network, destination, addresses) } @@ -156,7 +156,7 @@ func (d *resolveParallelNetworkDialer) DialParallelInterface(ctx context.Context fallbackDelay = d.fallbackDelay } if d.parallel { - return DialParallelNetwork(ctx, d.dialer, network, destination, addresses, d.queryOptions.Strategy == C.DomainStrategyPreferIPv6, strategy, interfaceType, fallbackInterfaceType, fallbackDelay) + return DialParallelNetwork(ctx, d.dialer, network, destination, addresses, addresses[0].Is6(), strategy, interfaceType, fallbackInterfaceType, fallbackDelay) } else { return DialSerialNetwork(ctx, d.dialer, network, destination, addresses, strategy, interfaceType, fallbackInterfaceType, fallbackDelay) }