]> git.proxmox.com Git - pve-network.git/commitdiff
bridge-disable-mac-learning : use $opts for tap_plug
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 24 Aug 2022 16:26:40 +0000 (18:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 13 Nov 2022 09:02:47 +0000 (10:02 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Network/SDN/Zones.pm
PVE/Network/SDN/Zones/Plugin.pm

index 492defd4c654d579eaf7e700f5c922fbd1f9aff5..f8e40b1f070db133eca37371156714943ad90def 100644 (file)
@@ -309,8 +309,9 @@ sub tap_plug {
     my $vnet = PVE::Network::SDN::Vnets::get_vnet($bridge, 1);
     if (!$vnet) { # fallback for classic bridge
        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);
+       my $opts = {};
+       $opts->{learning} = 0 if $interfaces_config->{ifaces}->{$bridge} && $interfaces_config->{ifaces}->{$bridge}->{'bridge-disable-mac-learning'};
+       PVE::Network::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate, $opts);
        return;
     }
 
index 1f5b5c22900b7b36d02a8d957ed471fe7a24a7cc..2c707b3094db4f16a445f5e0feb1eb4262db4315 100644 (file)
@@ -227,7 +227,9 @@ 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, $plugin_config->{'bridge-disable-mac-learning'});
+    my $opts = {};
+    $opts->{learning} = 0 if $plugin_config->{'bridge-disable-mac-learning'};
+    PVE::Network::tap_plug($iface, $vnetid, $tag, $firewall, $trunks, $rate, $opts);
 }
 
 #helper