From e4eb3b2ded524fef470a4899330b50bae879ae0b Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 15 Mar 2023 23:26:57 +0700 Subject: [PATCH] Do not query ipv6 eagerly when setup bootstrap IP We only need on demand information when re-bootstrapping. On Bootsrap, this is already checked by ctrldnet.Up, so on demand query will cause un-necessary slow down if external ipv6 is slow to response. --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index b1582f6..81366c5 100644 --- a/config.go +++ b/config.go @@ -207,7 +207,7 @@ func (uc *UpstreamConfig) SetupBootstrapIP() { uc.nextBootstrapIP.Add(1) // If this is an ipv6, and ipv6 is not available, don't use it as bootstrap ip. - if !ctrldnet.IPv6Available(ctx) && ctrldnet.IsIPv6(ip) { + if !ctrldnet.SupportsIPv6() && ctrldnet.IsIPv6(ip) { continue } uc.BootstrapIP = ip