Browse Source

Detect ipv6 addresses

pull/2310/head
nivekuil 3 years ago
parent
commit
0fe9d2997b
  1. 2
      weed/util/network.go

2
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()
}
}

Loading…
Cancel
Save