mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-26 21:01:14 +08:00
style: Fix some more linter warnings for GOOS=windows
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
@@ -29,22 +29,27 @@ func dnsClientConfig() (*dns.ClientConfig, error) {
|
||||
}
|
||||
|
||||
resolvers := map[string]bool{}
|
||||
|
||||
for _, addr := range addresses {
|
||||
for next := addr.FirstUnicastAddress; next != nil; next = next.Next {
|
||||
if addr.OperStatus != windows.IfOperStatusUp {
|
||||
continue
|
||||
}
|
||||
|
||||
if next.Address.IP() != nil {
|
||||
for dnsServer := addr.FirstDnsServerAddress; dnsServer != nil; dnsServer = dnsServer.Next {
|
||||
ip := dnsServer.Address.IP()
|
||||
if ip.IsMulticast() || ip.IsLinkLocalMulticast() || ip.IsLinkLocalUnicast() || ip.IsUnspecified() {
|
||||
continue
|
||||
}
|
||||
|
||||
if ip.To16() != nil && strings.HasPrefix(ip.To16().String(), "fec0:") {
|
||||
continue
|
||||
}
|
||||
|
||||
resolvers[ip.String()] = true
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user