mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-12-23 12:09:47 +00:00
c3f837e122
This commit add IsIPv6Only function inside `internal/ip` package and moving `geo` package from `internal/geo` to `internal/ip/geo`. Although it increases server resource usage, checking hostname to IP is required every time the prober sends a report so that the `ipv6_only` record in the database is not up-to-date. Previously, this feature did not exist.
16 lines
260 B
Go
16 lines
260 B
Go
// Package ip provides IP address related functions
|
|
package ip
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
// IsIPv6Only returns true if all given IPs are IPv6
|
|
func IsIPv6Only(ips []net.IP) bool {
|
|
for _, ip := range ips {
|
|
if ip.To4() != nil {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|