]> git.proxmox.com Git - pve-network.git/commitdiff
subnets: only delete macs.db entries if mac is available
authorStefan Hanreich <s.hanreich@proxmox.com>
Wed, 22 Nov 2023 12:27:28 +0000 (13:27 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 22 Nov 2023 13:05:08 +0000 (14:05 +0100)
When removing a gateway do not attempt to delete its entry from
macs.db since we do not have anything cached for the gateway anyway.

Reported-By: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
src/PVE/Network/SDN/Subnets.pm

index 8e2a6aa85a876046972ad777d56e7e279ba24183..05d2de26c6016c490336b163bc160a14655787d3 100644 (file)
@@ -399,7 +399,7 @@ sub del_ip {
        my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type});
        $plugin->del_ip($plugin_config, $subnetid, $subnet, $ip);
 
-       eval { PVE::Network::SDN::Ipams::del_cache_mac_ip($mac, $ip); };
+       eval { PVE::Network::SDN::Ipams::del_cache_mac_ip($mac, $ip) if $mac; };
        warn $@ if $@;
     }