From: Alexandre Derumier Date: Thu, 4 Jan 2024 16:11:39 +0000 (+0100) Subject: ipam: phpipam: add_range_next_freeip X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e4e815872245b42a5c1c0f26cfb77a9b2013d752;p=mirror%2Fpve-network.git ipam: phpipam: add_range_next_freeip Currently is not possible in phpipam to search in specific range, fallback to full subnet search Signed-off-by: Alexandre Derumier --- diff --git a/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm b/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm index ecefd77..c3e545f 100644 --- a/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm +++ b/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm @@ -184,6 +184,18 @@ sub add_next_freeip { return $ip; } +sub add_range_next_freeip { + my ($class, $plugin_config, $subnet, $range, $data, $noerr) = @_; + + #not implemented in phpipam, we search in the full subnet + + my $vmid = $data->{vmid}; + my $mac = $data->{mac}; + my $hostname = $data->{hostname}; + + return $class->add_next_freeip($plugin_config, undef, $subnet, $hostname, $mac, $vmid); +} + sub del_ip { my ($class, $plugin_config, $subnetid, $subnet, $ip, $noerr) = @_;