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 376791FF09C for ; Mon, 02 Nov 2026 13:50:29 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 98286219B9; Mon, 02 Nov 2026 13:48:45 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer v4 30/30] tui: network: list bond member candidates sharing a MAC address once Date: Mon, 2 Nov 2026 13:45:36 +0100 Message-ID: <20261102124539.1008075-31-c.heiss@proxmox.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261102124539.1008075-1-c.heiss@proxmox.com> References: <20261102124539.1008075-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793623696180 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.182 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: D2HWHZZHA47EDPY6AQCCNVJ6VTVZRQQ6 X-Message-ID-Hash: D2HWHZZHA47EDPY6AQCCNVJ6VTVZRQQ6 X-MailFrom: c.heiss@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: Bond members are identified by their MAC address, so physical links sharing one, for example on hardware that does not assign each port a unique address, cannot be told apart in the bond configuration anyway. Listing each of them only results in entries that toggle the same member, which then also ends up twice in the member list if both are checked. Only list the first of these links. When refreshing the labels after the pinned names changed, only consider physical links, as virtual ones like bridges or bonds can share the MAC address of a physical link and would show up with their name instead. Originally-by: Thomas Lamprecht Signed-off-by: Christoph Heiss --- Changes v3 -> v4: * no changes Changes v2 -> v3: * new patch proxmox-tui-installer/src/views/network.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/proxmox-tui-installer/src/views/network.rs b/proxmox-tui-installer/src/views/network.rs index af0528a..15b078f 100644 --- a/proxmox-tui-installer/src/views/network.rs +++ b/proxmox-tui-installer/src/views/network.rs @@ -8,7 +8,7 @@ use cursive::{ }, }; use std::{ - collections::{BTreeMap, HashMap}, + collections::{BTreeMap, HashMap, HashSet}, net::IpAddr, sync::{Arc, Mutex}, }; @@ -644,10 +644,12 @@ impl BondOptionsView { .child(DummyView::new()); let mut checkboxes = CheckboxGroup::::new(); + // members are identified by MAC address, so links sharing one cannot be told apart + let mut listed_macs = HashSet::new(); for iface in options .interfaces .iter() - .filter(|iface| iface.pinned_id.is_some()) + .filter(|iface| iface.pinned_id.is_some() && listed_macs.insert(iface.mac)) { let label = Self::format_interface_label(options, iface); let is_member = options.bond_options.members_list.contains(&iface.mac); @@ -709,7 +711,11 @@ impl BondOptionsView { |group: &mut CheckboxGroup| { let options = options_ref.lock().expect("unpoisoned lock"); group.update_labels(&|_, label, mac| { - if let Some(iface) = options.interfaces.iter().find(|iface| iface.mac == *mac) { + if let Some(iface) = options + .interfaces + .iter() + .find(|iface| iface.pinned_id.is_some() && iface.mac == *mac) + { label.set_content(Self::format_interface_label(&options, iface)); } }); -- 2.55.0