aboutsummaryrefslogtreecommitdiffstats
path: root/modules/util/net.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/util/net.go')
-rw-r--r--modules/util/net.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/modules/util/net.go b/modules/util/net.go
index 54c0a2ca39..0339325dc3 100644
--- a/modules/util/net.go
+++ b/modules/util/net.go
@@ -8,12 +8,6 @@ import (
"net"
)
-// IsIPPrivate for net.IP.IsPrivate. TODO: replace with `ip.IsPrivate()` if min go version is bumped to 1.17
func IsIPPrivate(ip net.IP) bool {
- if ip4 := ip.To4(); ip4 != nil {
- return ip4[0] == 10 ||
- (ip4[0] == 172 && ip4[1]&0xf0 == 16) ||
- (ip4[0] == 192 && ip4[1] == 168)
- }
- return len(ip) == net.IPv6len && ip[0]&0xfe == 0xfc
+ return ip.IsPrivate()
}