]> git.proxmox.com Git - pve-network.git/commitdiff
zones: add del_bridge_fdb
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 24 Sep 2021 08:51:01 +0000 (10:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Mar 2022 15:38:09 +0000 (16:38 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Network/SDN/Zones.pm

index b8c7e6232d7811a13f3e349a52aa6bd4205a4d95..492defd4c654d579eaf7e700f5c922fbd1f9aff5 100644 (file)
@@ -338,5 +338,19 @@ sub add_bridge_fdb {
     PVE::Network::add_bridge_fdb($iface, $macaddr, $firewall) if $plugin_config->{'bridge-disable-mac-learning'};
 }
 
+sub del_bridge_fdb {
+    my ($iface, $macaddr, $bridge, $firewall) = @_;
+
+    my $vnet = PVE::Network::SDN::Vnets::get_vnet($bridge, 1);
+    if (!$vnet) { # fallback for classic bridge
+       PVE::Network::del_bridge_fdb($iface, $macaddr, $firewall);
+       return;
+    }
+
+    my $plugin_config = get_plugin_config($vnet);
+    my $plugin = PVE::Network::SDN::Zones::Plugin->lookup($plugin_config->{type});
+    PVE::Network::del_bridge_fdb($iface, $macaddr, $firewall) if $plugin_config->{'bridge-disable-mac-learning'};
+}
+
 1;