From 9c4c286696d7eaea3dc613c0112ca237d78232b3 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 23 Aug 2024 17:17:37 +0200 Subject: [PATCH] fix warning errs from beta2 (#2075) * remove default false for use usernames causing warning Fixes #2065 Signed-off-by: Kristoffer Dalby * Ensure DoH warnings are only emitted if err Fixes #2064 Signed-off-by: Kristoffer Dalby --------- Signed-off-by: Kristoffer Dalby --- hscontrol/types/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hscontrol/types/config.go b/hscontrol/types/config.go index 30fa1c6b3e..0b7d63b720 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -246,7 +246,6 @@ func LoadConfig(path string, isFile bool) error { viper.SetDefault("dns.nameservers.split", map[string]string{}) viper.SetDefault("dns.search_domains", []string{}) viper.SetDefault("dns.extra_records", []tailcfg.DNSRecord{}) - viper.SetDefault("dns.use_username_in_magic_dns", false) viper.SetDefault("derp.server.enabled", false) viper.SetDefault("derp.server.stun.enabled", true) @@ -600,6 +599,8 @@ func (d *DNSConfig) GlobalResolvers() []*dnstype.Resolver { resolvers = append(resolvers, &dnstype.Resolver{ Addr: nsStr, }) + + continue } else { warn = fmt.Sprintf("Invalid global nameserver %q. Parsing error: %s ignoring", nsStr, err) } @@ -636,6 +637,8 @@ func (d *DNSConfig) SplitResolvers() map[string][]*dnstype.Resolver { resolvers = append(resolvers, &dnstype.Resolver{ Addr: nsStr, }) + + continue } else { warn = fmt.Sprintf("Invalid split dns nameserver %q. Parsing error: %s ignoring", nsStr, err) }