You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Warn users that they're using an old method of ranging
fmt.Println("ipfilter Warning: You are using an old method of ranging over IPs, it's highly recommended to switch over to CIDR notation, For more: https://caddyserver.com/docs/ipfilter")
maxLen := 32
a1 = a1.To4()
a2 = a2.To4()
for cmp(a1, a2) <= 0 {
l := 32
for l > 0 {
m := net.CIDRMask(l-1, maxLen)
if cmp(a1, first(a1, m)) != 0 || cmp(last(a1, m), a2) > 0 {
break
}
l--
}
r = append(r, &net.IPNet{IP: a1, Mask: net.CIDRMask(l, maxLen)})