ipn/ipnlocal: return early, outdent a bunch in dnsConfigForNetmap
@@ -1838,7 +1838,10 @@ func dnsConfigForNetmap(nm *netmap.NetworkMap, prefs *ipn.Prefs, logf logger.Log
dcfg.Hosts[fqdn] = append(dcfg.Hosts[fqdn], ip)
}
- if prefs.CorpDNS {
+ if !prefs.CorpDNS {
+ return dcfg
+ }
+
addDefault := func(resolvers []dnstype.Resolver) {
for _, r := range resolvers {
dcfg.DefaultResolvers = append(dcfg.DefaultResolvers, normalizeResolver(r))
@@ -1905,7 +1908,7 @@ func dnsConfigForNetmap(nm *netmap.NetworkMap, prefs *ipn.Prefs, logf logger.Log
// We don't support split DNS at all on Android yet.
addDefault(nm.DNS.FallbackResolvers)
}
- }
+
return dcfg
}
