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 A680E1FF0C0 for ; Wed, 04 Nov 2026 10:56:49 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 93529216A5; Wed, 04 Nov 2026 10:56:07 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v5 11/13] ui: sdn: dhcp tree: do not merge the same subnet in different zones Date: Wed, 4 Nov 2026 10:55:18 +0100 Message-ID: <20261104095520.398544-12-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261104095520.398544-1-h.laimer@proxmox.com> References: <20261104095520.398544-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793786137992 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.189 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 URIBL_BLACK 3 Contains an URL listed in the URIBL blacklist [element.name] Message-ID-Hash: KWGYXROFOYW3ESDSYJ26TVVUEJ44A4AD X-Message-ID-Hash: KWGYXROFOYW3ESDSYJ26TVVUEJ44A4AD 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: Two zones can each have a subnet with the same CIDR. The tree keyed its subnet nodes by the CIDR alone, so it listed the mappings of both zones under the subnet of one of them. The vnet of the other zone did not show the subnet. Signed-off-by: Hannes Laimer --- www/manager6/tree/DhcpTree.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/manager6/tree/DhcpTree.js b/www/manager6/tree/DhcpTree.js index 40eb40bf9408..23f91fe51996 100644 --- a/www/manager6/tree/DhcpTree.js +++ b/www/manager6/tree/DhcpTree.js @@ -60,7 +60,9 @@ Ext.define('PVE.sdn.DhcpTree', { zones[element.zone].children.push(vnet); } - if (!(element.subnet in subnets)) { + // the same subnet can exist in several zones + let subnetKey = `${element.zone}/${element.subnet}`; + if (!(subnetKey in subnets)) { let subnet = { name: element.subnet, zone: element.zone, @@ -71,14 +73,14 @@ Ext.define('PVE.sdn.DhcpTree', { children: [], }; - subnets[element.subnet] = subnet; + subnets[subnetKey] = subnet; vnets[element.vnet].children.push(subnet); } element.name = element.vmid; // for sorting element.type = 'mapping'; element.iconCls = 'x-tree-icon-none'; - subnets[element.subnet].children.push(element); + subnets[subnetKey].children.push(element); }); me.getView().setRootNode(root); -- 2.47.3