From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 2C0CB1FF165 for ; Thu, 6 Nov 2025 13:06:24 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10726150AA; Thu, 6 Nov 2025 13:07:03 +0100 (CET) Mime-Version: 1.0 Date: Thu, 06 Nov 2025 13:06:28 +0100 Message-Id: From: "Christoph Heiss" To: "Stoiko Ivanov" X-Mailer: aerc 0.21.0 References: <20251030110627.812398-1-c.heiss@proxmox.com> <20251030110627.812398-16-c.heiss@proxmox.com> <20251106101521.56191e73@rosa.proxmox.com> In-Reply-To: <20251106101521.56191e73@rosa.proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762430769086 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.044 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_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_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [jsonschema.pm] Subject: Re: [pve-devel] [PATCH installer v2 15/15] gui: add support for pinning network interface names X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Thu Nov 6, 2025 at 10:15 AM CET, Stoiko Ivanov wrote: > Thanks for tackling this! the first experience with this in GUI/TUI was > good and I'm looking forward to having this available in our installers! Thanks for taking a look at it! > > I ran into an issue and difference of behavior between GUI/TUI (and from a > quick grep in our codebase between TUI and our API types) - my test was > using single character iface names ('a', '_'). > > Comment inline: > On Thu, 30 Oct 2025 12:06:17 +0100 > Christoph Heiss wrote: [..] >> + $dialog->signal_connect( >> + response => sub { >> + my $new_mapping = {}; >> + my $reverse_mapping = {}; >> + foreach my $mac (keys %$inputs) { >> + my $name = $inputs->{$mac}->get_text(); >> + >> + if (!defined($name) || $name eq '') { >> + Proxmox::UI::message( >> + "interface name mapping for '$mac' cannot be empty", $dialog, >> + ); >> + return; >> + } >> + >> + if (length($name) > MAX_IFNAME_LEN) { >> + Proxmox::UI::message( >> + "interface name mapping '$name' for '$mac' cannot be longer than " >> + . MAX_IFNAME_LEN >> + . " characters", >> + $dialog, >> + ); >> + return; >> + } >> + >> + if ($name =~ m/^[0-9]/) { >> + Proxmox::UI::message( >> + "interface name mapping '$name' for '$mac' is invalid: must not start with a number", >> + $dialog, >> + ); >> + return; >> + } >> + >> + if ($name !~ m/^[a-zA-Z][a-zA-Z0-9_]+$/) { >> + Proxmox::UI::message( >> + "interface name mapping '$name' for '$mac' is invalid: " >> + . "must only consist alphanumeric characters and underscores", > I received this as error-message when using 'a' as nic-name - so the error > message does not cover that case - but looking through your other patches > and also a bit later through json-schema: > pve-common/src/PVE/JSONSchema.pm - this regex here seems correct - and the Yeah, it's _mostly_ modeled after that regex, minus the VLAN & co parts. > checks in the TUI are allowing too much (another nit there is the > error-message when using '_' as interface name ('must not start with a > number'). Thanks for testing that pretty thoroughly! I will go through all the cases again. > > I did not check if we have similar inconsistencies in our rust-based > pinning vs. the perl-based one - but if possible unifying what is allowed > in all our installer interfaces would be good (most likely by disallowing > the single-character ifaces) Disallowing single-character names would be indeed correct, since that is what the rest of our tooling enforces AFAICS. I actually thought about (finally) introducing perlmod into the installer, so that we don't have to keep duplicating all checks between Perl and Rust, for the GUI and TUI/auto-installer, respectively. > I'll give the autoinstaller a spin on one of our test-boxes with many > interfaces next. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel