From 0fe9d2997b6236cf488195856e7c5a87f57bc720 Mon Sep 17 00:00:00 2001 From: nivekuil Date: Sun, 5 Sep 2021 06:21:40 -0700 Subject: [PATCH] Detect ipv6 addresses --- weed/util/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/util/network.go b/weed/util/network.go index 55a123667..a3ea82330 100644 --- a/weed/util/network.go +++ b/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() } }