diff options
| author | Alexandre Derumier <aderumier@odiso.com> | 2020-10-05 17:08:52 +0200 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2020-10-06 18:12:38 +0200 |
| commit | ee4f339e8026c7dbe793e112bdcb5b1981c6a66e (patch) | |
| tree | 3efef498011e00bd4acb404e5dc7b482c0943f80 /PVE/Network/SDN/Vnets.pm | |
| parent | 70b035064290a014759ce62e0093df00cd7d62fe (diff) | |
add DNS plugin
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Diffstat (limited to 'PVE/Network/SDN/Vnets.pm')
| -rw-r--r-- | PVE/Network/SDN/Vnets.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/PVE/Network/SDN/Vnets.pm b/PVE/Network/SDN/Vnets.pm index 6ea3a9a..c9916b1 100644 --- a/PVE/Network/SDN/Vnets.pm +++ b/PVE/Network/SDN/Vnets.pm @@ -55,7 +55,7 @@ sub get_vnet { } sub get_next_free_ip { - my ($vnet, $ipversion) = @_; + my ($vnet, $hostname, $ipversion) = @_; $ipversion = 4 if !$ipversion; my $subnets_cfg = PVE::Network::SDN::Subnets::config(); @@ -71,7 +71,7 @@ sub get_next_free_ip { $subnet = $subnets_cfg->{ids}->{$subnetid}; if ($subnet && $subnet->{ipam}) { eval { - $ip = PVE::Network::SDN::Subnets::next_free_ip($subnetid, $subnet); + $ip = PVE::Network::SDN::Subnets::next_free_ip($subnetid, $subnet, $hostname); }; warn $@ if $@; } @@ -83,23 +83,23 @@ sub get_next_free_ip { } sub add_ip { - my ($vnet, $cidr, $name) = @_; + my ($vnet, $cidr, $hostname) = @_; my ($ip, $mask) = split(/\//, $cidr); my ($subnetid, $subnet) = PVE::Network::SDN::Subnets::find_ip_subnet($ip, $vnet->{subnets}); return if !$subnet->{ipam}; - PVE::Network::SDN::Subnets::add_ip($subnetid, $subnet, $ip); + PVE::Network::SDN::Subnets::add_ip($subnetid, $subnet, $ip, $hostname); } sub del_ip { - my ($vnet, $cidr) = @_; + my ($vnet, $cidr, $hostname) = @_; my ($ip, $mask) = split(/\//, $cidr); my ($subnetid, $subnet) = PVE::Network::SDN::Subnets::find_ip_subnet($ip, $vnet->{subnets}); return if !$subnet->{ipam}; - PVE::Network::SDN::Subnets::del_ip($subnetid, $subnet, $ip); + PVE::Network::SDN::Subnets::del_ip($subnetid, $subnet, $ip, $hostname); } 1; |
