[pve-devel] [pve-network 2/4] vnets: add_next_free_cidr : skip if ipamreservation is not defined

Alexandre Derumier aderumier at odiso.com
Thu Jan 4 17:27:31 CET 2024


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/Network/SDN/Vnets.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Network/SDN/Vnets.pm b/src/PVE/Network/SDN/Vnets.pm
index 060cb3c..0268684 100644
--- a/src/PVE/Network/SDN/Vnets.pm
+++ b/src/PVE/Network/SDN/Vnets.pm
@@ -103,7 +103,7 @@ sub add_next_free_cidr {
     my $zoneid = $vnet->{zone};
     my $zone = PVE::Network::SDN::Zones::get_zone($zoneid);
 
-    return if !$zone->{ipam};
+    return if !$zone->{ipam} || !$zone->{'ipamreservation'};
 
     my $subnets = PVE::Network::SDN::Vnets::get_subnets($vnetid, 1);
 
-- 
2.39.2




More information about the pve-devel mailing list