[pve-devel] [PATCH pve-network 3/4] zones: add add_bridge_fdb

Alexandre Derumier aderumier at odiso.com
Fri Sep 24 10:51:00 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 c59a724..011446f 100644
--- a/PVE/Network/SDN/Zones.pm
+++ b/PVE/Network/SDN/Zones.pm
@@ -323,5 +323,19 @@ sub tap_plug {
     $plugin->tap_plug($plugin_config, $vnet, $tag, $iface, $bridge, $firewall, $trunks, $rate);
 }
 
+sub add_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::add_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::add_bridge_fdb($iface, $macaddr, $firewall) if $plugin_config->{'bridge-disable-mac-learning'};
+}
+
 1;
 
-- 
2.30.2




More information about the pve-devel mailing list