Fix CIDR calculation in expandACLPeerAddr

This commit is contained in:
Juan Font
2023-04-04 22:41:00 +00:00
parent 50b706eeed
commit dfc5d861c7
2 changed files with 73 additions and 2 deletions

View File

@@ -213,11 +213,11 @@ func expandACLPeerAddr(srcIP string) []string {
return []string{from.String()}
}
for from != too {
for from != too && from.Less(too) {
addrs = append(addrs, from.String())
from = from.Next()
}
addrs = append(addrs, too.String()) // Add the last IP address in the range
return addrs
}