]> git.proxmox.com Git - pve-network.git/blobdiff - src/PVE/Network/SDN/Subnets.pm
dhcp: fix allocating IP for every defined dhcp-range
[pve-network.git] / src / PVE / Network / SDN / Subnets.pm
index b05b3d9ad7f821ad2855a62982be32912c8be7c7..8e2a6aa85a876046972ad777d56e7e279ba24183 100644 (file)
@@ -238,7 +238,7 @@ sub add_next_free_ip {
 
                foreach my $range (@$dhcp_ranges) {
                    $ip = $plugin->add_range_next_freeip($plugin_config, $subnet, $range, $data);
-                   next if !$ip;
+                   last if $ip;
                }
            } else {
                $ip = $plugin->add_next_freeip($plugin_config, $subnetid, $subnet, $hostname, $mac, $vmid);