parent
b7929b8bce
commit
e350b7aafa
|
@ -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