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 8719C1FF0B6 for ; Thu, 12 Nov 2026 11:47:01 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 70C4D2166C; Thu, 12 Nov 2026 11:46:58 +0100 (CET) Message-ID: <09cdb7a8-ce76-4846-a15c-ab822828efab@proxmox.com> Date: Thu, 12 Nov 2026 11:46:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-network] config: release the addresses of a NIC removed from a running container To: pve-devel@lists.proxmox.com References: <20261112104059.2377096-1-h.laimer@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <20261112104059.2377096-1-h.laimer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794480415552 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: SYYHXF7PYEYQ6JF7AE6PLVCNOPUCY4TC X-Message-ID-Hash: SYYHXF7PYEYQ6JF7AE6PLVCNOPUCY4TC 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: oops, this is for pve-container, not pve-network sorry On 2026-11-12 11:41, Hannes Laimer wrote: > 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");