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 85E621FF0A5 for ; Fri, 04 Sep 2026 11:39:45 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B7E712168A; Fri, 04 Sep 2026 11:38:48 +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: Fri, 4 Sep 2026 11:38:29 +0200 Message-ID: <20260904093835.1050030-7-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260904093835.1050030-1-h.laimer@proxmox.com> References: <20260904093835.1050030-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: 1788514720627 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.631 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: 2HAMGXEAOSES56W3FVNOGXHJCR5OOICF X-Message-ID-Hash: 2HAMGXEAOSES56W3FVNOGXHJCR5OOICF 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 a9459b4..ec4898a 100644 --- a/src/PVE/Network/SDN/Dhcp.pm +++ b/src/PVE/Network/SDN/Dhcp.pm @@ -90,11 +90,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 $@; } @@ -141,7 +144,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