[pve-devel] [pve-network 5/5] ipam: phpipam: add_range_next_freeip

Alexandre Derumier aderumier at odiso.com
Thu Jan 4 17:11:39 CET 2024


Currently is not possible in phpipam to search in specific range,
fallback to full subnet search

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm b/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm
index bb9f322..1c6159c 100644
--- a/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm
@@ -185,6 +185,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) = @_;
 
-- 
2.39.2




More information about the pve-devel mailing list