diff --git a/web/job/check_clinet_ip_job.go b/web/job/check_clinet_ip_job.go index fa5bc254..066a5cda 100644 --- a/web/job/check_clinet_ip_job.go +++ b/web/job/check_clinet_ip_job.go @@ -277,9 +277,8 @@ func LocalIP() ([]string, error) { ip = v.IP } - if isPrivateIP(ip) { - ips = append(ips,ip.String()) - } + ips = append(ips,ip.String()) + } } logger.Debug("System IPs : ",ips) @@ -287,29 +286,6 @@ func LocalIP() ([]string, error) { return ips, nil } -func isPrivateIP(ip net.IP) bool { - var privateIPBlocks []*net.IPNet - for _, cidr := range []string{ - // don't check loopback ips - //"127.0.0.0/8", // IPv4 loopback - //"::1/128", // IPv6 loopback - //"fe80::/10", // IPv6 link-local - "10.0.0.0/8", // RFC1918 - "172.16.0.0/12", // RFC1918 - "192.168.0.0/16", // RFC1918 - } { - _, block, _ := net.ParseCIDR(cidr) - privateIPBlocks = append(privateIPBlocks, block) - } - - for _, block := range privateIPBlocks { - if block.Contains(ip) { - return true - } - } - - return false -} func IPsToRegex(ips []string) (string){