mirror of
git://git.proxmox.com/git/pve-network.git
synced 2025-04-30 11:27:11 +02:00
dhcp: fix allocating IP for every defined dhcp-range
Due to the wrong check an IP was allocated for every DHCP range, instead of only allocating an IP in the first free DHCP range. Suggested-By: Stefan Lendl <s.lendl@proxmox.com> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
This commit is contained in:
parent
5ab15238af
commit
04e1c8ed73
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue