]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Subnets.pm
subnets/ipam : fix is_gateway
[pve-network.git] / PVE / Network / SDN / Subnets.pm
index 0cdadf791cca63a807d08df698499ab8f3bceb84..0231822ce0a2493cff5894ca140501b90ec9ec8b 100644 (file)
@@ -165,6 +165,7 @@ sub add_subnet {
     my ($zone, $subnetid, $subnet) = @_;
 
     my $ipam = $zone->{ipam};
+    return if !$ipam;
     my $ipam_cfg = PVE::Network::SDN::Ipams::config();
     my $plugin_config = $ipam_cfg->{ids}->{$ipam};
     my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type});
@@ -175,6 +176,7 @@ sub del_subnet {
     my ($zone, $subnetid, $subnet) = @_;
 
     my $ipam = $zone->{ipam};
+    return if !$ipam;
     my $ipam_cfg = PVE::Network::SDN::Ipams::config();
     my $plugin_config = $ipam_cfg->{ids}->{$ipam};
     my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type});
@@ -230,7 +232,7 @@ sub next_free_ip {
 }
 
 sub add_ip {
-    my ($zone, $subnetid, $subnet, $ip, $hostname, $mac, $description) = @_;
+    my ($zone, $subnetid, $subnet, $ip, $hostname, $mac, $description, $is_gateway) = @_;
 
     return if !$subnet || !$ip; 
 
@@ -257,7 +259,7 @@ sub add_ip {
        my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type});
 
        eval {
-           $plugin->add_ip($plugin_config, $subnetid, $subnet, $ip, $hostname, $mac, $description);
+           $plugin->add_ip($plugin_config, $subnetid, $subnet, $ip, $hostname, $mac, $description, $is_gateway);
        };
        die $@ if $@;
     }