mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Detect ipv6 addresses
This commit is contained in:
parent
a7383a8a1c
commit
0fe9d2997b
|
@ -24,7 +24,7 @@ func DetectedHostAddress() string {
|
|||
|
||||
for _, a := range addrs {
|
||||
if ipNet, ok := a.(*net.IPNet); ok && !ipNet.IP.IsLoopback() {
|
||||
if ipNet.IP.To4() != nil {
|
||||
if ipNet.IP.To4() != nil || ipNet.IP.To16() != nil {
|
||||
return ipNet.IP.String()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue