all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common/stable-8] fix #7181: backport: consider bonds as physical bridge ports
Date: Mon, 22 Dec 2025 21:24:18 +0100	[thread overview]
Message-ID: <20251222202431.1142212-1-s.ivanov@proxmox.com> (raw)

This is a backport of:
8516622 ("fix #7153: iproute2: consider bonds as physical bridge ports")

the needed changes were moving the code into PVE/Network.pm
(PVE/IPRoute2.pm got created in PVE 9.0) and adapting the method
declaration to pre v5.36 behavior (not signatured subs).

minimally tested with a reproducer based on the report in #7181.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PVE/Network.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index 9a8449a..7961eb0 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -970,7 +970,8 @@ sub get_physical_bridge_ports {
     $ip_links = ip_link_details() if !defined($ip_links);
 
     return grep {
-        ip_link_is_physical($ip_links->{$_}) && $ip_links->{$_}->{master} eq $bridge
+        (ip_link_is_physical($ip_links->{$_}) || ip_link_is_bond($ip_links->{$_}))
+            && defined($ip_links->{$_}->{master}) && $ip_links->{$_}->{master} eq $bridge
     } keys $ip_links->%*;
 }
 
@@ -999,6 +1000,15 @@ sub ip_link_is_physical {
         && (!defined($ip_link->{linkinfo}) || !defined($ip_link->{linkinfo}->{info_kind}));
 }
 
+sub ip_link_is_bond {
+    my ($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 'bond';
+}
+
 sub altname_mapping {
     my ($ip_links) = @_;
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-12-22 20:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 20:24 Stoiko Ivanov [this message]
2025-12-23  8:11 ` [pve-devel] applied: " Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251222202431.1142212-1-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal