check ranges bi-directionally

master
Stephen McQuay 5 years ago
parent 08019f5593
commit f0f51f7f77
Signed by: sm
GPG Key ID: 4E4B72F479BA3CE5

@ -67,7 +67,10 @@ func NoOverlap(subnets []*net.IPNet) error {
firstLastIP[i] = []net.IP{first, last}
}
for i, s := range subnets {
for j := i + 1; j < len(subnets); j++ {
for j := range subnets {
if i == j {
continue
}
first := firstLastIP[j][0]
last := firstLastIP[j][1]
if s.Contains(first) || s.Contains(last) {

Loading…
Cancel
Save