mirror of https://github.com/status-im/consul.git
parent
437222fbe7
commit
41f01a0cfc
|
@ -310,7 +310,7 @@ func (a *Agent) consulConfig() (*consul.Config, error) {
|
|||
|
||||
default:
|
||||
ip, err := consul.GetPrivateIP()
|
||||
if a.config.BindAddr == "[::]" {
|
||||
if isIPv6ANY(a.config.BindAddr) {
|
||||
ip, err = consul.GetPublicIPv6()
|
||||
}
|
||||
if err != nil {
|
||||
|
|
|
@ -1986,5 +1986,13 @@ func isAddrANY(ip interface{}) bool {
|
|||
default:
|
||||
panic(fmt.Sprintf("invalid type: %T", ip))
|
||||
}
|
||||
return ips == "0.0.0.0" || ips == "::" || ips == "[::]"
|
||||
return isIPv4Any(ips) || isIPv6ANY(ips)
|
||||
}
|
||||
|
||||
func isIPv4Any(ip string) bool {
|
||||
return ip == "0.0.0.0"
|
||||
}
|
||||
|
||||
func isIPv6ANY(ip string) bool {
|
||||
return ip == "::" || ip == "[::]"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue