Skip to content

Commit

Permalink
update if
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziomal12 committed Apr 10, 2024
1 parent b57a5be commit 9dc091a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions management/server/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,17 @@ func AllocatePeerIP(ipNet net.IPNet, takenIps []net.IP) (net.IP, error) {
}

// pick the smallest available IP if sequential assignment is enabled
if assignSequentialIPs {
if assignSequentialIPs == 1 {
return ips[0], nil
}
} else {

// pick a random IP
s := rand.NewSource(time.Now().Unix())
r := rand.New(s)
intn := r.Intn(len(ips))

return ips[intn], nil
}
}


Expand Down

0 comments on commit 9dc091a

Please sign in to comment.