[pve-devel] [PATCH pve-network 2/7] api2: ipam : remove add|del_mapping in mac/ip management

Alexandre Derumier aderumier at odiso.com
Sat Nov 18 15:13:09 CET 2023


only register/del ip in ipam here.

The dhcp mapping is done a vm start.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/API2/Network/SDN/Ipam.pm | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/PVE/API2/Network/SDN/Ipam.pm b/src/PVE/API2/Network/SDN/Ipam.pm
index e71ca7d..722baa4 100644
--- a/src/PVE/API2/Network/SDN/Ipam.pm
+++ b/src/PVE/API2/Network/SDN/Ipam.pm
@@ -114,14 +114,11 @@ __PACKAGE__->register_method ({
 	my $vnet = extract_param($param, 'vnet');
 	my $mac = extract_param($param, 'mac');
 
-	PVE::Network::SDN::Dhcp::remove_mapping($vnet, $mac);
-
 	eval {
 	    PVE::Network::SDN::Vnets::del_ips_from_mac($vnet, $mac);
 	};
 	my $error = $@;
 
-	PVE::Network::SDN::Vnets::add_dhcp_mapping($vnet, $mac) if $error;
 	die "$error\n" if $error;
 
 	return undef;
@@ -159,7 +156,6 @@ __PACKAGE__->register_method ({
 	my $ip = extract_param($param, 'ip');
 
 	PVE::Network::SDN::Vnets::add_ip($vnet, $ip, '', $mac, undef);
-	PVE::Network::SDN::Vnets::add_dhcp_mapping($vnet, $mac);
 
 	return undef;
     },
@@ -198,7 +194,6 @@ __PACKAGE__->register_method ({
 	my $vmid = extract_param($param, 'vmid');
 	my $ip = extract_param($param, 'ip');
 
-	PVE::Network::SDN::Dhcp::remove_mapping($vnet, $mac);
 	my ($old_ip4, $old_ip6) = PVE::Network::SDN::Vnets::del_ips_from_mac($vnet, $mac, '');
 
 	eval {
@@ -211,8 +206,6 @@ __PACKAGE__->register_method ({
 	    PVE::Network::SDN::Vnets::add_ip($vnet, $old_ip6, '', $mac, $vmid) if $old_ip6;
 	}
 
-	PVE::Network::SDN::Vnets::add_dhcp_mapping($vnet, $mac);
-
 	die "$error\n" if $error;
 	return undef;
     },
-- 
2.39.2





More information about the pve-devel mailing list