vnet: do not skip if no range is defined, ask for allocation inside prefix instead

Signed-off-by: lou lecrivain <lou.lecrivain@wdz.de>
Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Link: https://lore.proxmox.com/mailman.181.1734119196.332.pve-devel@lists.proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Lou Lecrivain 2024-12-13 20:45:37 +01:00 committed by Thomas Lamprecht
parent 1b01ad6529
commit 7603197666

View file

@ -118,11 +118,10 @@ 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 {
$ip = PVE::Network::SDN::Subnets::add_next_free_ip($zone, $subnetid, $subnet, $hostname, $mac, $vmid, $skipdns, $dhcprange); $ip = PVE::Network::SDN::Subnets::add_next_free_ip($zone, $subnetid, $subnet, $hostname, $mac, $vmid, $skipdns, $subnet->{'dhcp-range'});
}; };
die $@ if $@; die $@ if $@;