Deactivate IPv6 integrations when no IPv6 stack is detected

This commit is contained in:
Daniel
2022-06-09 13:50:18 +02:00
parent 0439894efc
commit c442a7e51c
4 changed files with 89 additions and 43 deletions

View File

@@ -259,7 +259,11 @@ func getListenAddresses(listenAddress string) (ip1, ip2 net.IP, port uint16, err
// listen separately for IPv4 and IPv6.
if ipString == "localhost" {
ip1 = net.IPv4(127, 0, 0, 17)
ip2 = net.IPv6loopback
if netenv.IPv6Enabled() {
ip2 = net.IPv6loopback
} else {
log.Warningf("nameserver: no IPv6 stack detected, disabling IPv6 nameserver listener")
}
} else {
ip1 = net.ParseIP(ipString)
if ip1 == nil {