mirror of
git://git.proxmox.com/git/pve-network.git
synced 2025-04-30 19:27:11 +02:00
sdn: dhcp: only consider subnets that have dhcp-range configured
If DHCP is enabled on a zone with subnets, but no subnet has a dhcp-range configured, then starting a VM will fail because no IP can be allocated. This patch fixes this by only considering subnets that have a dhcp-range configured and only failing if there is at least one subnet with a dhcp-range configured. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com> Reviewed-by: Stefan Lendl <s.lendl@proxmox.com> Tested-by: Stefan Lendl <s.lendl@proxmox.com> Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
This commit is contained in:
parent
5fd3da139b
commit
c60a7dc432
|
@ -118,6 +118,7 @@ sub add_next_free_cidr {
|
||||||
my $network = $subnet->{network};
|
my $network = $subnet->{network};
|
||||||
|
|
||||||
next if Net::IP::ip_get_version($network) != $ipversion || $ips->{$ipversion};
|
next if Net::IP::ip_get_version($network) != $ipversion || $ips->{$ipversion};
|
||||||
|
next if !$subnet->{'dhcp-range'};
|
||||||
$subnetcount++;
|
$subnetcount++;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
|
|
Loading…
Reference in a new issue