[pve-devel] [PATCH pve-network 5/6] fix #4683 : zones: qinq: fix vlan-protocol with bridge vlan aware

Alexandre Derumier aderumier at odiso.com
Thu Apr 20 23:36:21 CEST 2023


The tagged bridge interface need to also have to correct vlan-protocol

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Zones/QinQPlugin.pm                       | 8 ++++++--
 .../bridge_vlanaware_vlanprotocol/expected_sdn_interfaces | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/PVE/Network/SDN/Zones/QinQPlugin.pm b/PVE/Network/SDN/Zones/QinQPlugin.pm
index f4d12bc..8b9de43 100644
--- a/PVE/Network/SDN/Zones/QinQPlugin.pm
+++ b/PVE/Network/SDN/Zones/QinQPlugin.pm
@@ -98,13 +98,17 @@ sub generate_sdn_config {
     } elsif ($vlan_aware) {
         # VLAN_aware_brige-(tag)----->vlanwarebridge-(tag)----->vnet
 
+	$zone_bridge_ports = "$bridge.$stag";
+
 	if ($vlanprotocol) {
 	    @iface_config = ();
 	    push @iface_config, "bridge-vlan-protocol $vlanprotocol";
 	    push(@{$config->{$bridge}}, @iface_config) if !$config->{$bridge};
-	}
 
-	$zone_bridge_ports = "$bridge.$stag";
+	    @iface_config = ();
+	    push @iface_config, "vlan-protocol $vlanprotocol";
+	    push(@{$config->{$zone_bridge_ports}}, @iface_config) if !$config->{$zone_bridge_ports};
+	}
 
     } else {
 	# eth--->eth.x(svlan)----->vlanwarebridge-(tag)----->vnet---->vnet
diff --git a/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces b/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces
index 0bc301b..b24238f 100644
--- a/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces
+++ b/test/zones/qinq/bridge_vlanaware_vlanprotocol/expected_sdn_interfaces
@@ -20,6 +20,10 @@ auto vmbr0
 iface vmbr0
 	bridge-vlan-protocol 802.1ad
 
+auto vmbr0.10
+iface vmbr0.10
+	vlan-protocol 802.1ad
+
 auto z_myzone
 iface z_myzone
 	bridge-stp off
-- 
2.30.2





More information about the pve-devel mailing list