[pve-devel] [PATCH pve-network 4/4] zones: add del_bridge_fdb
Alexandre Derumier
aderumier at odiso.com
Fri Sep 24 10:51:01 CEST 2021
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Network/SDN/Zones.pm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/PVE/Network/SDN/Zones.pm b/PVE/Network/SDN/Zones.pm
index 011446f..39988b6 100644
--- a/PVE/Network/SDN/Zones.pm
+++ b/PVE/Network/SDN/Zones.pm
@@ -337,5 +337,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;
--
2.30.2
More information about the pve-devel
mailing list