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 4CDEA1FF141 for ; Mon, 16 Mar 2026 15:08:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 944ED1C53E; Mon, 16 Mar 2026 15:08:36 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 16 Mar 2026 15:08:31 +0100 Message-Id: To: "Proxmox VE development discussion" Subject: Re: [pve-devel] [PATCH installer] auto: answer: netif pinning: transform mac addresses into lowercase From: "Christoph Heiss" X-Mailer: aerc 0.21.0 References: <20260114145208.1500825-1-c.heiss@proxmox.com> In-Reply-To: <20260114145208.1500825-1-c.heiss@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773670071265 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 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.819 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.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: PM4V7DGQJDEERIMRBOFFMOILZVUF4FPW X-Message-ID-Hash: PM4V7DGQJDEERIMRBOFFMOILZVUF4FPW 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: Ping, still applies. On Wed Jan 14, 2026 at 3:51 PM CET, Christoph Heiss wrote: > Users may specify MAC addresses in the network interface pinning map in > an uppercase format, which is more common than lowercase in some > environments. > > This would then cause the auto-installer to mistakenly consider these > addresses as unknown - thus just unconditionally convert all MAC > addresses to lowercase while parsing. > > Reported-by: Aaron Lauterer > Signed-off-by: Christoph Heiss > --- > proxmox-auto-installer/src/answer.rs | 7 ++++- > proxmox-auto-installer/tests/parse-answer.rs | 1 + > ...terface_pinning_uppercase_mac_address.json | 30 +++++++++++++++++++ > ...terface_pinning_uppercase_mac_address.toml | 22 ++++++++++++++ > 4 files changed, 59 insertions(+), 1 deletion(-) > create mode 100644 proxmox-auto-installer/tests/resources/parse_answer/n= etwork_interface_pinning_uppercase_mac_address.json > create mode 100644 proxmox-auto-installer/tests/resources/parse_answer/n= etwork_interface_pinning_uppercase_mac_address.toml > > diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installe= r/src/answer.rs > index 1e455ca..d12e088 100644 > --- a/proxmox-auto-installer/src/answer.rs > +++ b/proxmox-auto-installer/src/answer.rs > @@ -225,8 +225,13 @@ impl TryFrom for Network { > let interface_name_pinning =3D match network.interface_name_pinn= ing { > Some(opts) if opts.enabled =3D> { > let opts =3D NetworkInterfacePinningOptions { > - mapping: opts.mapping, > + mapping: opts > + .mapping > + .iter() > + .map(|(k, v)| (k.to_lowercase(), v.clone())) > + .collect(), > }; > + > opts.verify()?; > Some(opts) > } > diff --git a/proxmox-auto-installer/tests/parse-answer.rs b/proxmox-auto-= installer/tests/parse-answer.rs > index 696fe1f..7dd4a9d 100644 > --- a/proxmox-auto-installer/tests/parse-answer.rs > +++ b/proxmox-auto-installer/tests/parse-answer.rs > @@ -130,6 +130,7 @@ mod tests { > hashed_root_password, > minimal, > network_interface_pinning, > + network_interface_pinning_uppercase_mac_address, > nic_matching, > specific_nic, > zfs, > diff --git a/proxmox-auto-installer/tests/resources/parse_answer/network_= interface_pinning_uppercase_mac_address.json b/proxmox-auto-installer/tests= /resources/parse_answer/network_interface_pinning_uppercase_mac_address.jso= n > new file mode 100644 > index 0000000..76723c8 > --- /dev/null > +++ b/proxmox-auto-installer/tests/resources/parse_answer/network_interfa= ce_pinning_uppercase_mac_address.json > @@ -0,0 +1,30 @@ > +{ > + "autoreboot": 1, > + "cidr": "192.168.1.114/24", > + "country": "at", > + "dns": "192.168.1.254", > + "domain": "testinstall", > + "filesys": "ext4", > + "gateway": "192.168.1.1", > + "hdsize": 223.57088470458984, > + "existing_storage_auto_rename": 1, > + "hostname": "pveauto", > + "keymap": "de", > + "mailto": "mail@no.invalid", > + "mngmt_nic": "mgmt", > + "network_interface_pin_map": { > + "1c:34:da:5c:5e:24": "nic2", > + "1c:34:da:5c:5e:25": "nic3", > + "24:8a:07:1e:05:bc": "lan0", > + "24:8a:07:1e:05:bd": "lan1", > + "5a:47:32:dd:c7:47": "nic8", > + "a0:36:9f:0a:b3:82": "nic6", > + "a0:36:9f:0a:b3:83": "nic7", > + "b4:2e:99:ac:ad:b4": "mgmt", > + "b4:2e:99:ac:ad:b5": "nic1" > + }, > + "root_password": { "plain": "12345678" }, > + "target_hd": "/dev/sda", > + "timezone": "Europe/Vienna", > + "first_boot": { "enabled": 0 } > +} > diff --git a/proxmox-auto-installer/tests/resources/parse_answer/network_= interface_pinning_uppercase_mac_address.toml b/proxmox-auto-installer/tests= /resources/parse_answer/network_interface_pinning_uppercase_mac_address.tom= l > new file mode 100644 > index 0000000..6681fe9 > --- /dev/null > +++ b/proxmox-auto-installer/tests/resources/parse_answer/network_interfa= ce_pinning_uppercase_mac_address.toml > @@ -0,0 +1,22 @@ > +[global] > +keyboard =3D "de" > +country =3D "at" > +fqdn =3D "pveauto.testinstall" > +mailto =3D "mail@no.invalid" > +timezone =3D "Europe/Vienna" > +root-password =3D "12345678" > + > +[network] > +source =3D "from-dhcp" > + > +[network.interface-name-pinning] > +enabled =3D true > + > +[network.interface-name-pinning.mapping] > +"24:8A:07:1E:05:BC" =3D "lan0" > +"24:8A:07:1E:05:BD" =3D "lan1" > +"B4:2E:99:AC:AD:B4" =3D "mgmt" > + > +[disk-setup] > +filesystem =3D "ext4" > +disk-list =3D ["sda"]