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 846011FF0BC for ; Thu, 29 Oct 2026 17:50:03 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id ACFA621598; Thu, 29 Oct 2026 17:49:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 smtp.infra.comaite.com B075862C04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comaite.com; s=377A38C6-3A8D-11E5-A0EC-E97757B27CB3; t=1793292580; bh=YoAiF/SpZvoHNO30QM4pRNjrFiK5ukWIM0phWCPnHoI=; h=From:To:Date:Message-ID:MIME-Version; b=jQMxuhka8EJgpa2rKNqbWrhFMRJmJB4dKaFpBpmnvx1/bH1SVnqmjwDmqedE8ENN8 AJmAFG6GxL1/gfNj6/31M1wRsIBqmZu836FueEHNW5MBwtuzM7uSWDyq47q/AwaMJ/ Y8AXFMoCESWcgkVoj81j3RrEycEORMPauVQ9TfXm5w0sZRnZT4JexA/9qh6bM2xNgv POC4pkNI6x04TcFJ4SOPFWCRCkrZguKmOHizySST6fYU2T1JWbZrJQHVSeNZk5K6yc ZL4/gQz5aJ9hdtVFLF3uWjVc1LXGxxM7qLTPat9aiidQ526ZtiX1Qg4xG0EM0hexXN UhYqxtxG5jW5w== From: =?UTF-8?q?R=C3=A9mi=20PAETA?= To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v2 2/2] fix #6490: network: add bridge fdb entries when hotplugging a nic Date: Thu, 29 Oct 2026 17:49:39 +0100 Message-ID: <20261029164939.1278135-3-remi.paeta@comaite.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261029164939.1278135-1-remi.paeta@comaite.com> References: <20261029164939.1278135-1-remi.paeta@comaite.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.833 Adjusted score from AWL reputation of From: address 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: 7XMNACXEHHVP5DPZD7HQYUW6CSGPNHQO X-Message-ID-Hash: 7XMNACXEHHVP5DPZD7HQYUW6CSGPNHQO 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, trunks or firewall setting changed. Re-plugging even drops the existing entries. The guest then loses connectivity on that NIC until its next start or migration, for example after enabling or disabling the firewall of the NIC. Add the forwarding database entries of the NIC after plugging it. On bridges with MAC learning enabled, this is a no-op. As the NIC is already plugged at that point, only warn if adding them fails, instead of failing the update and leaving the configuration out of sync with the running VM. Link: https://bugzilla.proxmox.com/show_bug.cgi?id=6490 Signed-off-by: Rémi PAETA --- src/PVE/QemuServer.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index b4a1a38d..626dc78a 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -4994,6 +4994,9 @@ sub vmconfig_update_net { $newnet->{trunks}, $newnet->{rate}, ); + # unplugging the interface dropped its forwarding database entries + eval { PVE::QemuServer::Network::add_nets_bridge_fdb({ $opt => $value }, $vmid) }; + log_warn("failed to add forwarding database entries of '$iface' - $@") if $@; } elsif (safe_num_ne($oldnet->{rate}, $newnet->{rate})) { # Rate can be applied on its own but any change above needs to @@ -5023,6 +5026,11 @@ sub vmconfig_update_net { $newnet->{bridge}, $newnet->{macaddr}, $vmid, $conf->{name}, ); vm_deviceplug($storecfg, $conf, $vmid, $opt, $newnet, $arch, $machine_type); + if ($newnet->{bridge}) { + # the NIC is plugged already, so do not fail the hotplug + eval { PVE::QemuServer::Network::add_nets_bridge_fdb({ $opt => $value }, $vmid) }; + log_warn("failed to add forwarding database entries of '$opt' - $@") if $@; + } } else { die "skip\n"; } -- 2.47.3