all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common/stable-8] fix #7181: backport: consider bonds as physical bridge ports
@ 2025-12-22 20:24 Stoiko Ivanov
  2025-12-23  8:11 ` [pve-devel] applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2025-12-22 20:24 UTC (permalink / raw)
  To: pve-devel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-23  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-22 20:24 [pve-devel] [PATCH common/stable-8] fix #7181: backport: consider bonds as physical bridge ports Stoiko Ivanov
2025-12-23  8:11 ` [pve-devel] applied: " Fabian Grünbichler

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