From cb39d7aa5cedfa99992f46c919cb3655c2beb6c3 Mon Sep 17 00:00:00 2001 From: Basavaraj PB Date: Sat, 7 Mar 2026 23:43:04 +0530 Subject: [PATCH] net: clarify documentation for Dialer.FallbackDelay The current documentation describes Fast Fallback as waiting for IPv6 to succeed before falling back to IPv4. In practice, the primary address family is determined by the first resolved address. Update the documentation to explain that the first resolved address family is treated as primary and the other family is used for fallback after FallbackDelay. Fixes #77967 Change-Id: I77779c9038493fba839cb13662cc4a40f2326bfe Reviewed-on: https://go-review.googlesource.com/c/go/+/752720 Reviewed-by: Sean Liao Reviewed-by: Carlos Amedee LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com Reviewed-by: Dmitri Shuralyov --- src/net/dial.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/net/dial.go b/src/net/dial.go index 10c0068449..8a1376d400 100644 --- a/src/net/dial.go +++ b/src/net/dial.go @@ -160,10 +160,13 @@ type Dialer struct { DualStack bool // FallbackDelay specifies the length of time to wait before - // spawning a RFC 6555 Fast Fallback connection. That is, this - // is the amount of time to wait for IPv6 to succeed before - // assuming that IPv6 is misconfigured and falling back to - // IPv4. + // spawning a RFC 6555 Fast Fallback connection. + // + // When dialing "tcp" and both IPv6 and IPv4 addresses are + // available, the address family of the first resolved address + // is treated as the primary. After FallbackDelay, a connection + // attempt to the other address family is started if the primary + // connection has not yet succeeded. // // If zero, a default delay of 300ms is used. // A negative value disables Fast Fallback support.