fix ipv4 last segment = 0 bug

This commit is contained in:
mz 2021-11-14 14:04:31 +08:00
parent 115bd2af03
commit cfe30c2f6a
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ func (r *IPRanges) chooseIPv6() {
for r.ipNet.Contains(r.firstIP) {
//fmt.Println(firstIP)
//fmt.Println(firstIP[0], firstIP[1], firstIP[2], firstIP[3], firstIP[4], firstIP[5], firstIP[6], firstIP[7], firstIP[8], firstIP[9], firstIP[10], firstIP[11], firstIP[12], firstIP[13], firstIP[14], firstIP[15])
if r.mask == "/128" {
if r.mask != "/128" {
r.firstIP[15] = randIPEndWith(255) // 随机 IP 的最后一段
r.firstIP[14] = randIPEndWith(255) // 随机 IP 的最后一段
}