Browse Source
Merge pull request #2310 from nivekuil/ipv6
Detect ipv6 addresses
pull/2321/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
weed/util/network.go
|
|
@ -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() |
|
|
|
} |
|
|
|
} |
|
|
|