all: use parallel dialer for bootstrapping ip

So we don't have to depend on network probing for checking ipv4/ipv6
enabled, making ctrld working more stably.
This commit is contained in:
Cuong Manh Le
2023-04-25 01:36:51 +07:00
committed by Cuong Manh Le
parent f73cbde7a5
commit 0af7f64bca
7 changed files with 108 additions and 95 deletions

View File

@@ -112,7 +112,7 @@ func resetDNS(iface *net.Interface) (err error) {
}
// TODO(cuonglm): handle DHCPv6 properly.
if ctrldnet.SupportsIPv6() {
if ctrldnet.IPv6Available(ctx) {
c := client6.NewClient()
conversation, err := c.Exchange(iface.Name)
if err != nil {

View File

@@ -74,7 +74,7 @@ func (p *prog) run() {
uc.Init()
if uc.BootstrapIP == "" {
uc.SetupBootstrapIP()
mainLog.Info().Str("bootstrap_ip", uc.BootstrapIP).Msgf("Setting bootstrap IP for upstream.%s", n)
mainLog.Info().Msgf("Bootstrap IPs for upstream.%s: %q", n, uc.BootstrapIPs())
} else {
mainLog.Info().Str("bootstrap_ip", uc.BootstrapIP).Msgf("Using bootstrap IP for upstream.%s", n)
}