all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves
@ 2025-07-30 16:39 Stefan Hanreich
  2025-07-30 17:29 ` Thomas Lamprecht
  2025-07-30 17:30 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hanreich @ 2025-07-30 16:39 UTC (permalink / raw)
  To: pve-devel

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


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

* Re: [pve-devel] [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves
  2025-07-30 16:39 [pve-devel] [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves Stefan Hanreich
@ 2025-07-30 17:29 ` Thomas Lamprecht
  2025-07-30 17:30 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2025-07-30 17:29 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stefan Hanreich

Am 30.07.25 um 18:39 schrieb Stefan Hanreich:
>     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.

I definitively think so too that a closer look would be great, if we got
access to the nlcache in the modulebase for addons it might be good to
translate there, OTOH.
Anyway, this seems straight forward enough and fixes the reproducer, so
I'll still apply it now, we can improve this tomorrow, if needed.


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


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

* [pve-devel] applied: [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves
  2025-07-30 16:39 [pve-devel] [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves Stefan Hanreich
  2025-07-30 17:29 ` Thomas Lamprecht
@ 2025-07-30 17:30 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2025-07-30 17:30 UTC (permalink / raw)
  To: pve-devel, Stefan Hanreich

On Wed, 30 Jul 2025 18:39:08 +0200, Stefan Hanreich wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] d/patches: fix issue when reloading bonds with altname slaves
      commit: 6ccaf70388e56d37dfafdba9f50163210f808f57


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


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

end of thread, other threads:[~2025-07-30 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-30 16:39 [pve-devel] [PATCH ifupdown2 1/1] d/patches: fix issue when reloading bonds with altname slaves Stefan Hanreich
2025-07-30 17:29 ` Thomas Lamprecht
2025-07-30 17:30 ` [pve-devel] applied: " Thomas Lamprecht

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