public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [PATCH pve-network] config: release the addresses of a NIC removed from a running container
Date: Thu, 12 Nov 2026 11:46:55 +0100	[thread overview]
Message-ID: <09cdb7a8-ce76-4846-a15c-ab822828efab@proxmox.com> (raw)
In-Reply-To: <20261112104059.2377096-1-h.laimer@proxmox.com>

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 <h.laimer@proxmox.com>
> ---
>  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");





  reply	other threads:[~2026-11-12 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 10:40 [PATCH pve-network] config: release the addresses of a NIC removed from a running container Hannes Laimer
2026-11-12 10:46 ` Hannes Laimer [this message]
2026-11-14 21:33 ` applied: " Thomas Lamprecht

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=09cdb7a8-ce76-4846-a15c-ab822828efab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal