From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 94FE71FF0B6 for ; Thu, 12 Nov 2026 11:41:16 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4D1AE21668; Thu, 12 Nov 2026 11:41:12 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network] config: release the addresses of a NIC removed from a running container Date: Thu, 12 Nov 2026 11:40:59 +0100 Message-ID: <20261112104059.2377096-1-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794480065395 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.293 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: T2NC3NC2LG7ZJ2RMAPPLEAHNJEEAM5L3 X-Message-ID-Hash: T2NC3NC2LG7ZJ2RMAPPLEAHNJEEAM5L3 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: Without `$class->..` the passed options ended up as the first argument, and the `undef` check on the second argument, `!$data`, ended up returning an empty hash. So the NIC's addresses were never released in the IPAM, and the DHCP client of a host-managed NIC was not stopped. Destroying the container did not release them either, since the NIC is gone from the config by then. Fixes: 036c5e9bb339 ("implement host-managed DHCP for containers with `ipmanagehost`") Signed-off-by: Hannes Laimer --- src/PVE/LXC/Config.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 70525098cd0f..b2f623394b21 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -1696,7 +1696,7 @@ sub vmconfig_hotplug_pending { $cgroup->change_cpu_shares(undef); } elsif ($opt =~ m/^net(\d)$/) { my $netid = $1; - my $net = parse_lxc_network($conf->{$opt}); + my $net = $class->parse_lxc_network($conf->{$opt}); PVE::LXC::kill_dhclients($vmid, $net->{name}) if $net->{'host-managed'}; PVE::Network::veth_delete("veth${vmid}i$netid"); -- 2.47.3