From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 178FA1FF17C for ; Tue, 30 Dec 2025 17:06:41 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AB621F40F; Tue, 30 Dec 2025 17:07:46 +0100 (CET) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Tue, 30 Dec 2025 17:06:58 +0100 Message-ID: <20251230160730.641868-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1767110834134 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.071 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH common] fix #7193: allow vlan-interfaces as physical bridge ports X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" as described in the bug-report having a vlan-interface on a physical NIC (eno1.1234) as bridge port - allowed users until 057f62f ("fix #7118: fix bridge port detection when plugging netdev with vlan") to stack 2 802.1q tags on a packet leaving a VM (not quite QinQ, as both packets have the TPID of a plain 802.1q tag [0]. the fix in the patch 057f62f allowed for nics to have arbitrary names, so I went ahead and only check if this is a VLAN-interface, without matching the name for the . pattern (that is quite common in debian-based systems but not the only way to configure a vlan-interface). Not sure if this is the cleanest way forward, but it fixes the regression in #7193 for me in a test-setup. [0] see: https://en.wikipedia.org/wiki/IEEE_802.1ad - the spec says the outer layer should have TPID (Tag protocol identifier ~ type) of 0x88A8 and the inner keep the regular 0x8100 from 802.1Q - but it seems this is not enforced by quite a number of switches in reality. Signed-off-by: Stoiko Ivanov --- will send a backport for stable-8 right away. src/PVE/IPRoute2.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/PVE/IPRoute2.pm b/src/PVE/IPRoute2.pm index 5c312d9..0480871 100644 --- a/src/PVE/IPRoute2.pm +++ b/src/PVE/IPRoute2.pm @@ -32,6 +32,14 @@ sub ip_link_is_physical($ip_link) { && (!defined($ip_link->{linkinfo}) || !defined($ip_link->{linkinfo}->{info_kind})); } +sub ip_link_is_vlan($ip_link) { + return + $ip_link->{link_type} eq 'ether' + && defined($ip_link->{linkinfo}) + && defined($ip_link->{linkinfo}->{info_kind}) + && $ip_link->{linkinfo}->{info_kind} eq "vlan"; +} + sub ip_link_is_bond($ip_link) { return $ip_link->{link_type} eq 'ether' @@ -75,7 +83,9 @@ sub get_physical_bridge_ports($bridge, $ip_links = undef) { } return grep { - (ip_link_is_physical($ip_links->{$_}) || ip_link_is_bond($ip_links->{$_})) + (ip_link_is_physical($ip_links->{$_}) + || ip_link_is_bond($ip_links->{$_}) + || ip_link_is_vlan($ip_links->{$_})) && defined($ip_links->{$_}->{master}) && $ip_links->{$_}->{master} eq $bridge } keys $ip_links->%*; -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel