]> git.proxmox.com Git - pve-network.git/commitdiff
zones : tap_plug: add support for disable bridge learning
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 24 Sep 2021 08:50:59 +0000 (10:50 +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
PVE/Network/SDN/Zones/Plugin.pm
PVE/Network/SDN/Zones/QinQPlugin.pm
PVE/Network/SDN/Zones/VlanPlugin.pm

index 62dadb1f60a23ac38aca3171c70d2b944ebbc684..32586e7f778268218e944a374285c8865ed3ed00 100644 (file)
@@ -308,7 +308,9 @@ sub tap_plug {
 
     my $vnet = PVE::Network::SDN::Vnets::get_vnet($bridge, 1);
     if (!$vnet) { # fallback for classic bridge
-       PVE::Network::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate);
+       my $interfaces_config = PVE::INotify::read_file('interfaces');
+       my $disablelearning = 1 if $interfaces_config->{ifaces}->{$bridge} && $interfaces_config->{ifaces}->{$bridge}->{'bridge-disable-mac-learning'};
+       PVE::Network::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate, $disablelearning);
        return;
     }
 
index ed14a50f5114c92c7ade00c60d3b60fa3235a3bf..1f5b5c22900b7b36d02a8d957ed471fe7a24a7cc 100644 (file)
@@ -227,7 +227,7 @@ sub tap_plug {
     my $vlan_aware = PVE::Tools::file_read_firstline("/sys/class/net/$vnetid/bridge/vlan_filtering");
     die "vm vlans are not allowed on vnet $vnetid" if !$vlan_aware && ($tag || $trunks);
 
-    PVE::Network::tap_plug($iface, $vnetid, $tag, $firewall, $trunks, $rate);
+    PVE::Network::tap_plug($iface, $vnetid, $tag, $firewall, $trunks, $rate, $plugin_config->{'bridge-disable-mac-learning'});
 }
 
 #helper
index 7b75476a88014a3f73921c54edbf79fc453b2628..f4d12bce2942a14a2defea38da69672395b3b87b 100644 (file)
@@ -39,6 +39,7 @@ sub options {
        nodes => { optional => 1},
        'tag' => { optional => 0 },
        'bridge' => { optional => 0 },
+        'bridge-disable-mac-learning' => { optional => 1 },
        'mtu' => { optional => 1 },
        'vlan-protocol' => { optional => 1 },
        dns => { optional => 1 },
index fbfbdccf518f6e462a9a7d61dc0a9935f98b87e5..0bb6b8a50446e0cdce79464be215310f20dbf55f 100644 (file)
@@ -25,6 +25,10 @@ sub properties {
        'bridge' => {
            type => 'string',
        },
+       'bridge-disable-mac-learning' => {
+           type => 'boolean',
+            description => "Disable auto mac learning.",
+       }
     };
 }
 
@@ -33,6 +37,7 @@ sub options {
     return {
        nodes => { optional => 1},
        'bridge' => { optional => 0 },
+       'bridge-disable-mac-learning' => { optional => 1 },
        mtu => { optional => 1 },
        dns => { optional => 1 },
        reversedns => { optional => 1 },