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: [PATCH pve-common 1/1] network: interfaces: add guard for substitution in slaves property
Date: Wed,  4 Nov 2026 17:04:54 +0100	[thread overview]
Message-ID: <20261104160456.447514-1-s.hanreich@proxmox.com> (raw)

Otherwise bonds with no slaves defined will trigger a perl warning
that substition is performed on an undefined variable.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 src/PVE/Network/Interfaces.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Network/Interfaces.pm b/src/PVE/Network/Interfaces.pm
index ad4d837..19d5b08 100644
--- a/src/PVE/Network/Interfaces.pm
+++ b/src/PVE/Network/Interfaces.pm
@@ -647,7 +647,7 @@ sub __interface_to_string($iface, $d, $family, $first_block, $ifupdown2 = undef)
 
     } elsif ($d->{type} eq 'bond') {
 
-        $d->{slaves} =~ s/[;,\s]+/ /g;
+        $d->{slaves} =~ s/[;,\s]+/ /g if $d->{slaves};
         my $slaves = $d->{slaves} || 'none';
         $raw .= "\tbond-slaves $slaves\n";
         $done->{slaves} = 1;
-- 
2.47.3





             reply	other threads:[~2026-11-04 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 16:04 Stefan Hanreich [this message]
2026-11-05 12:33 ` applied: [PATCH pve-common 1/1] network: interfaces: add guard for substitution in slaves property Fiona Ebner

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=20261104160456.447514-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