mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-03-13 02:35:57 +08:00
修复 在使用 -allip 参数时 /32 子网掩码识别为两个 IP 的问题
This commit is contained in:
@@ -27,6 +27,9 @@ func InitRandSeed() {
|
||||
}
|
||||
|
||||
func randIPEndWith(num byte) byte {
|
||||
if num == 0 { // 对于 /32 这种单独的 IP
|
||||
return byte(0)
|
||||
}
|
||||
return byte(rand.Intn(int(num)))
|
||||
}
|
||||
|
||||
@@ -86,10 +89,6 @@ func (r *IPRanges) getIPRange() (minIP, hosts byte) {
|
||||
hosts = 255
|
||||
return
|
||||
}
|
||||
if total == 0 {
|
||||
hosts = 1
|
||||
return
|
||||
}
|
||||
hosts = byte(total)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user