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 EF6351FF0AE for ; Tue, 13 Oct 2026 12:17:32 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C6E1A21333; Tue, 13 Oct 2026 12:17:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 smtp.infra.comaite.com 86EDC62BE7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comaite.com; s=377A38C6-3A8D-11E5-A0EC-E97757B27CB3; t=1791885532; bh=+Gbz8GSj6H1bBaJxX35wuHrjjeOxA11N2/WqFRlJFlU=; h=From:To:Date:Message-ID:MIME-Version; b=b4bhoZFzbecdI5s4YTck23zuOpwgWeszScsBgkIuuIhezcV5phY0wTlU8/Q6D4XFs sxfCD+/jnxTYfgooajxu+t6DoGiz3RneEdvtU5yUKtp1jOA6dyUl4V5uFdJx+KqWmN sdexL4Yr8gdEXidyZxgv+rv8J87BdhZj1SIhB4/q7OWHcaH4iyG7cVtThp/c2ngQFS /fYCe8z5XouNKg83AxaSIEXrnFzLh+DDEBreh1mzI9MKrDIVKueFAECHMMbpjT3KIe 9Z95pP/ji/Cpjjcy9/6YMPcvKvwsHPqr8Rr9NQ1PbBE8tAe2uoW+wg1UynpwWw/YQ4 WK2pitc7uyogQ== From: =?UTF-8?q?R=C3=A9mi=20PAETA?= To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server] fix #6490: network: add bridge fdb entries when hotplugging a nic Date: Tue, 13 Oct 2026 11:58:52 +0200 Message-ID: <20261013095852.2586609-1-remi.paeta@comaite.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy 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: VAIG7LJ6XBDQZJ2IR65OMHRQWYPJ4GGD X-Message-ID-Hash: VAIG7LJ6XBDQZJ2IR65OMHRQWYPJ4GGD X-MailFrom: remi.paeta@comaite.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: On bridges with MAC learning disabled, the forwarding database entries of the guest NICs are added on VM start and on resume after a migration, but not when a NIC gets hotplugged or re-plugged because its bridge, VLAN tag or firewall setting changed. Re-plugging even drops the existing entries. The guest then loses connectivity on that NIC until its next start, for example after enabling or disabling the firewall of the NIC, and the migration of the VM fails at the end, as deleting the missing entries fails. Add the forwarding database entries of the NIC after plugging it. On bridges with MAC learning enabled, this is a no-op. Link: https://bugzilla.proxmox.com/show_bug.cgi?id=6490 Signed-off-by: Rémi PAETA --- I am contributing on behalf of my employer, Comaite. Its entity CLA was signed and sent to office@proxmox.com on 2026-10-09. Comaite would be happy to make its first contribution to the Proxmox code with this patch. Tested on a Linux bridge with bridge-disable-mac-learning: toggling the firewall of a NIC, hotplugging a NIC and live migrating the VM afterwards. Without the patch, the NIC loses connectivity and the migration fails on 'bridge fdb del'; with it, the entries are there and the migration succeeds. src/PVE/QemuServer.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 74772fdd..4c2bd334 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -5126,6 +5126,8 @@ sub vmconfig_update_net { $newnet->{trunks}, $newnet->{rate}, ); + # unplugging the interface dropped its forwarding database entries + PVE::QemuServer::Network::add_nets_bridge_fdb({ $opt => $value }, $vmid); } elsif (safe_num_ne($oldnet->{rate}, $newnet->{rate})) { # Rate can be applied on its own but any change above needs to @@ -5155,6 +5157,7 @@ sub vmconfig_update_net { $newnet->{bridge}, $newnet->{macaddr}, $vmid, $conf->{name}, ); vm_deviceplug($storecfg, $conf, $vmid, $opt, $newnet, $arch, $machine_type); + PVE::QemuServer::Network::add_nets_bridge_fdb({ $opt => $value }, $vmid); } else { die "skip\n"; } -- 2.47.3