From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id B9A9D1FF0A7 for ; Wed, 02 Sep 2026 14:48:39 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 575BB21581; Wed, 02 Sep 2026 14:48:09 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network 06/12] sdn: dhcp: only assert a backend's availability for zones using it Date: Wed, 2 Sep 2026 14:47:33 +0200 Message-ID: <20260902124739.750853-7-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260902124739.750853-1-h.laimer@proxmox.com> References: <20260902124739.750853-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788353262924 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.682 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: LVW5WN6PXW3VRRMLYUL3GPQ6T3UVTOA5 X-Message-ID-Hash: LVW5WN6PXW3VRRMLYUL3GPQ6T3UVTOA5 X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: before_regenerate got a single any-zone-needs-dhcp flag, so any zone with dhcp configured made every registered backend assert its own availability, and a failing assert aborts the whole regenerate. With one backend that was the same thing, with a second one it breaks network reloads on nodes that only run the other backend. Gate each backend on the zones actually using it. Signed-off-by: Hannes Laimer --- src/PVE/Network/SDN/Dhcp.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PVE/Network/SDN/Dhcp.pm b/src/PVE/Network/SDN/Dhcp.pm index 65e40d4..4d937dc 100644 --- a/src/PVE/Network/SDN/Dhcp.pm +++ b/src/PVE/Network/SDN/Dhcp.pm @@ -69,11 +69,14 @@ sub regenerate_config { my $plugins = PVE::Network::SDN::Dhcp::Plugin->lookup_types(); - my $any_zone_needs_dhcp = grep { $_->{dhcp} } values $zone_cfg->{ids}->%*; + my %plugin_needed = (); + for my $zone (values $zone_cfg->{ids}->%*) { + $plugin_needed{ $zone->{dhcp} } = 1 if $zone->{dhcp}; + } foreach my $plugin_name (@$plugins) { my $plugin = PVE::Network::SDN::Dhcp::Plugin->lookup($plugin_name); - eval { $plugin->before_regenerate(!$any_zone_needs_dhcp) }; + eval { $plugin->before_regenerate(!$plugin_needed{$plugin_name}) }; die "Could not run before_regenerate for DHCP plugin $plugin_name $@\n" if $@; } @@ -120,7 +123,7 @@ sub regenerate_config { warn "Could not configure vnet $vnetid: $@\n" if $@; } - eval { $dhcp_plugin->after_configure($zoneid, !$any_zone_needs_dhcp) }; + eval { $dhcp_plugin->after_configure($zoneid, !$plugin_needed{$dhcp_plugin_name}) }; warn "Could not run after_configure for DHCP server $zoneid $@\n" if $@; } -- 2.47.3