From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5B1BB1FF191 for ; Tue, 4 Nov 2025 17:01:52 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 83F651164A; Tue, 4 Nov 2025 17:02:29 +0100 (CET) To: pve-devel@lists.proxmox.com Date: Tue, 4 Nov 2025 12:20:25 +0000 X-Mailman-Approved-At: Tue, 04 Nov 2025 17:02:27 +0100 MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Philippos Giavridis via pve-devel Precedence: list Cc: Philippos Giavridis X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH pve-network 0/1] Fix duplicate DHCP leases for cloned VMs with same MAC Content-Type: multipart/mixed; boundary="===============7357974140858378489==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============7357974140858378489== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2933BD8BAC for ; Tue, 4 Nov 2025 13:26:13 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 08B91B9C9 for ; Tue, 4 Nov 2025 13:26:13 +0100 (CET) Received: from outbound.st.icloud.com (p-east2-cluster2-host1-snip4-9.eps.apple.com [57.103.78.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 4 Nov 2025 13:26:11 +0100 (CET) Received: from outbound.st.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-1a-60-percent-5 (Postfix) with ESMTPS id 9E13618000AB; Tue, 4 Nov 2025 12:20:46 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; bh=aZ3xH8zSiqqd8Fr9p9oB1VFXGfowOk3GwdIkA91TEdE=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=ZtFwAVUkH80EQLhwfVpBWzLngJrHZDh6zniqoYtyVWztq26eoG+QJPh2i0nufxAqoBuIW/BfdlMQYGAEe1Z0rXRrGOT9Y+1EEjv7S+aWwWqfH+3z80M+k3NEopidbbmhdwMjRnNTq0x+MfNwZuelgwu5WteA48n267L3P2k/ht+v6rPmAiiE9LwXVSfcrNBTvIKJ2eo3gWygJAU8VGXDq/fGE/7y0i1QgIm3TCIKcOYTB3gLDclxDKCCwvmAFVaZ9P6kgL+eNY1FO3YzXQydP6n/pOeSPBwQVEJa0bE/OjEQ146iLgk9n/Nffp2hdclxwK7N8o3qT5vBLJFR2jy2yA== Received: from roaring-lionus.eu-west-2.compute.internal (unknown [17.42.251.67]) by p00-icloudmta-asmtp-us-east-1a-60-percent-5 (Postfix) with ESMTPSA id 90C19180012F; Tue, 4 Nov 2025 12:20:45 +0000 (UTC) From: Philippos Giavridis To: pve-devel@lists.proxmox.com Cc: Philippos Giavridis Subject: [PATCH pve-network 0/1] Fix duplicate DHCP leases for cloned VMs with same MAC Date: Tue, 4 Nov 2025 12:20:25 +0000 Message-ID: <20251104122026.62228-1-philippos.g@me.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTA0MDEwMiBTYWx0ZWRfX2joQcnLuEmM0 V2yQTRWpEc+HWtTa1jupxxLzmFw3SDwl7+MHuGzxJWkHVD6BovkOEZkxl0yJGrUqsFJxSNhJUyL ui920TUgkOypw2bZHU8u7NjHrHNE1DJ4h+8l149ZuVrPlKRyd71gTKvyYiEDbpRodvhp2q6Lyig l/vtod+jvfecpglBqhIWj1QRhcyMYBFSehr1+dtkb7OR4aUd6lP0cMQ4uKx9VMuJDJfWdHAhMVV GnffO/doVS+IQWibvkH9mrQB4w05Y9lMoXKKUpMcL3Kjx0im7pqedhoUL/BaBn9BElVFvWz2U= X-Proofpoint-ORIG-GUID: k0kmPwDPT5l_SbxjDED5hb7nCE8_ZSqq X-Proofpoint-GUID: k0kmPwDPT5l_SbxjDED5hb7nCE8_ZSqq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-04_01,2025-11-03_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=879 clxscore=1011 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2511040102 X-JNJ: AAAAAAABYvKEgMJwuYJPnF/9QsfIMOe6EC2c/jbCBvMjOGjU3ewotHZIV137NEZwhipjeZ2Fb0xq2I2By29IGQBSiLK+84OIM0uDp2Wrhvc95hUt6Zpo78SvUSwpX8siM39m4AG7FpdIv2aG6Gs6oTIOKrZPCyB0ip2kCwaPcr+F70URPZhMHOKinYUWySM/ISr7FzeQJ8H4oEn5HeSMUOtZn2ATojFQ7Z26Fh84aKmPpVJQPpsG7gBHEsY0pj9ZYIYkHw0UQtwMfxO0xC/lfJM3leMFY6ANiNZ2EfSTmDKfz4bI29xmp3CoxngSG6gWOT7TCtm4RXO0KO/cGqwjASzfiYCpCbYf7SFbHLaE7BMm3J5xIaiUJIVHCnFJ4dNDPjsvtej67r29Lqv/keks2LlyCUV4Cb0Tu+eeFfVc+qO8KhAFJ5oTd6yHLTZPBoJAmdKkp7NO0D6iUBabY/TzyQaajA4zK1SmSHQgFYLl9V8sgRwSONuGOnuTkiCtFIrtqtZGlL1djjiI58MmEbaCbFBxCm9h+jmvc6Fudz4KC9aJmXXUo/MYFUMAZrTG1pqOtBhyjMT01GyuhxnOA3fRVjJ2eRSD8fVlSe3POcmAmxVfImATYybN46+DcqWKl/7GlpEUlD96 X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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 FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record X-Mailman-Approved-At: Tue, 04 Nov 2025 17:02:27 +0100 This patch fixes an issue where cloned VMs with identical MAC addresses receive different IP addresses instead of their reserved static DHCP leases. The current behaviour allows duplicate MAC addresses in the IPAM database, which leads to unexpected IP assignments. When a VM template with a static DHCP reservation is cloned and the clone keeps the same MAC address (or I assign it a NIC with the same MAC), it receives a new dynamic IP rather than the existing reservation. This patch adds a check for existing MAC-to-IP mappings before allocating new addresses, so that VMs with already-registered MAC addresses in IPAM receive their previously assigned IPs. The issue was discovered and discussed in the Proxmox forum: https://forum.proxmox.com/threads/ipam-reserving-dhcp-leases-via-mac-addresses.174704/ I have tested this on PVE 8.4 and 9.0. Philippos Giavridis (1): fix: prevent duplicate DHCP leases for identical MAC address src/PVE/Network/SDN/Subnets.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.43.0 --===============7357974140858378489== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============7357974140858378489==--