all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-network] sdn: dhcp: only regenerate if no cfg is undef
Date: Mon, 31 Aug 2026 15:06:47 +0200	[thread overview]
Message-ID: <20260831130647.1016625-1-h.laimer@proxmox.com> (raw)

Except for when there is no `.running-config` at all, these three can't
really be `undef`, and that is what this guard should check.

These three can either all be `undef`, or none. So this does not change
behaviour, but should be a little clearer.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/PVE/Network/SDN/Dhcp.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Network/SDN/Dhcp.pm b/src/PVE/Network/SDN/Dhcp.pm
index 65e40d4..f6ce842 100644
--- a/src/PVE/Network/SDN/Dhcp.pm
+++ b/src/PVE/Network/SDN/Dhcp.pm
@@ -63,7 +63,7 @@ sub regenerate_config {
     my $zone_cfg = $cfg->{zones};
     my $vnet_cfg = $cfg->{vnets};
     my $subnet_cfg = $cfg->{subnets};
-    return if !$zone_cfg && !$subnet_cfg;
+    return if !$zone_cfg || !$vnet_cfg || !$subnet_cfg;
 
     my $nodename = PVE::INotify::nodename();
 
-- 
2.47.3





                 reply	other threads:[~2026-08-31 13:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260831130647.1016625-1-h.laimer@proxmox.com \
    --to=h.laimer@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