From 9dc091a5f72186a667ff30931f7dd4a9fe34a1f7 Mon Sep 17 00:00:00 2001 From: Ziomal12 Date: Wed, 10 Apr 2024 18:51:46 +0200 Subject: [PATCH] update if --- management/server/network.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/management/server/network.go b/management/server/network.go index 5c04156e96e..c7df1041e55 100644 --- a/management/server/network.go +++ b/management/server/network.go @@ -139,9 +139,9 @@ 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()) @@ -149,6 +149,7 @@ func AllocatePeerIP(ipNet net.IPNet, takenIps []net.IP) (net.IP, error) { intn := r.Intn(len(ips)) return ips[intn], nil + } }