fix full ip lost 255 bug

This commit is contained in:
mz 2021-11-13 18:27:11 +08:00
parent ed0a8bbfea
commit 2fa023c7f3
1 changed files with 2 additions and 2 deletions

View File

@ -95,8 +95,8 @@ func (r *IPRanges) chooseIPv4() {
minIP, hosts := r.getIPRange()
for r.ipNet.Contains(r.firstIP) {
if TestAll { // 如果是测速全部 IP
for i := byte(0); i < hosts; i++ { // 遍历 IP 最后一段最小值到最大值
r.appendIPv4(i + minIP)
for i := 0; i <= int(hosts); i++ { // 遍历 IP 最后一段最小值到最大值
r.appendIPv4(byte(i) + minIP)
}
} else { // 随机 IP 的最后一段 0.0.0.X
r.appendIPv4(minIP + randIPEndWith(hosts))