all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves
Date: Wed, 30 Jul 2025 18:39:08 +0200	[thread overview]
Message-ID: <20250730163910.412108-1-s.hanreich@proxmox.com> (raw)

When reloading the network configuration via ifupdown2 and a bond has
bridge-slaves defined with their altname, the bond would break after
reloading - then work again after every second reload.

The issue for this is that the port list is parsed directly via
parse_port_list, provided by the modulebase. This method doesn't do
any translation of altnames. This leads to a wrong detection of
pre-existing slave interfaces when reloading. ifupdown then tries to
enslave the interfaces with the 'real' name and un-enslave the
interfaces with the altname, leading to no interfaces being enslaved
to the bond at all.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---

Notes:
    Might want to hold off on applying this one until Christoph could take
    a closer look. While I couldn't find issues with bridge_ports and VLAN
    devices in my tests, both modules also use parse_port_list so I think
    a closer look is warranted as well for those invocations. This solves
    the bond issue on my test node at least.

 ...r-addons-add-transparent-support-interface-a.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/debian/patches/pve/0011-nlmanager-addons-add-transparent-support-interface-a.patch b/debian/patches/pve/0011-nlmanager-addons-add-transparent-support-interface-a.patch
index 5a67c6a..5c8fe18 100644
--- a/debian/patches/pve/0011-nlmanager-addons-add-transparent-support-interface-a.patch
+++ b/debian/patches/pve/0011-nlmanager-addons-add-transparent-support-interface-a.patch
@@ -51,6 +51,17 @@ index 2af5cf6..ef6d37a 100644
  
      def _is_bond(self, ifaceobj):
          # at first link_kind is not set but once ifupdownmain
+@@ -301,6 +302,10 @@
+                or ifaceobj.get_attr_value_first("bond-mode") \
+                or self.get_bond_slaves(ifaceobj)
+ 
++    def parse_port_list(self, ifacename, port_expr, ifacenames=None):
++        port_list = super().parse_port_list(ifacename, port_expr, ifacenames)
++        return self.cache.link_translate_altnames(port_list)
++
+     def get_dependent_ifacenames(self, ifaceobj, ifacenames_all=None, old_ifaceobjs=False):
+         """ Returns list of interfaces dependent on ifaceobj """
+ 
 diff --git a/ifupdown2/addons/bridge.py b/ifupdown2/addons/bridge.py
 index 87bcda9..1da8de7 100644
 --- a/ifupdown2/addons/bridge.py
-- 
2.47.2


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


             reply	other threads:[~2025-07-30 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 16:39 Stefan Hanreich [this message]
2025-07-30 17:29 ` Thomas Lamprecht
2025-07-30 17:30 ` [pve-devel] applied: " Thomas Lamprecht

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=20250730163910.412108-1-s.hanreich@proxmox.com \
    --to=s.hanreich@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