From nobody Sat May 16 16:44:41 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gHqfk5cx5z6cghx for ; Sat, 16 May 2026 16:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gHqfk43Lyz3wm4 for ; Sat, 16 May 2026 16:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778949886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8y1LwbebhMA85JfRh2QuH1XnA09Z80eNKEjQQdhRqf8=; b=EpcrCUq1pyP/BJMpisrNmTKRlZu04ZZdjiOYwO+WYVcx7IPnASnTXcjVVLzBED9Gb4nJYT cfDRJyGaM/7A81Mj2CfHaa1XpPOQBduEAXhZ/uIyShG+5sduIhDYqxRpkpG/l7/u8aUdVG MW3gpNihHmU4DVPs2sVuSN000K8CSLokH0dYMkR0AET+vDCK9c6uOJC7UxV/drh9uiVuxQ S58BhhqlmUntpCmlY7nY67T4ZEOL7YR2pcWTY/SweerEqP7dYARpQ/oJyE2ax2SIDbP4FN jN3uAR6fvkQoLYEPxj8GYkZtTUNV4g6Z4UTqch5/p5K9RJXPzmpHuX0a0xfufQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778949886; a=rsa-sha256; cv=none; b=uo7p7FRnRUIGCda1kKa3WfdWGlYQyYTw8vKRYFadV1POdYR7+LXySs/1M+hAkpQ45k7J1B mtdjaN8/pcmFiEcEayf8TR0t3858WCr3lI77BMvBTvWiJi01Wf5ziYkOWL4fpLDW+IQZQK 2QzzwdBKHfi+LQVdvmhk+nQ52pHD63kdMRe5XB9u2lz6tqRm+X4P0b2x60OCEd2kga5J7t ErYKoeZ5HUxNkE6M3Hxbi7QXTTOefQpKwl2lXGYdbaXmT0Tf9GPfQ4d2SfAOwQMSKWqz10 YyQO+GAKFSVEpeAb3ibaFWLNx6/jPHOYvzy4qMNNsp5jzz+bcrpkzpj0Mgf+SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778949886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8y1LwbebhMA85JfRh2QuH1XnA09Z80eNKEjQQdhRqf8=; b=pYpa3hL/qjgELcllvUJt8fGvr5keqN4zTlf82B9bWG7cWrhElqaX8JCgizjJmyaquY57ne ncEuGP2JpqGRUis8VuHL9pkNgXZqQtFkzp0UWzBKqV7P617hvo5CFN+dvz26juXkZuJ4PE V5QJmVx1wOVO869jguwmeMgGzkbbakmNBFh473nXGqzA+waOxGDRVAc1kLgohrorzsbinD KSCRc06+KwKb5R0zMZMnWdpowTKhssqISCMlFH8qH25A2bMu+1+kvgwchNRHZXA+zJlyEG S/syV5uwyqQvkizcsRRS+veg/SyzTs3SbQhMq5gGekBPiyQt8t+tboUjsomKcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gHqfk3M3wz12Jp for ; Sat, 16 May 2026 16:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18969 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 16 May 2026 16:44:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 9d0b771caa49 - stable/15 - pfctl: relax interface name requirement List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9d0b771caa49eb77176d8f8cece8d1232dffe7f2 Auto-Submitted: auto-generated Date: Sat, 16 May 2026 16:44:41 +0000 Message-Id: <6a089ef9.18969.685b873a@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d0b771caa49eb77176d8f8cece8d1232dffe7f2 commit 9d0b771caa49eb77176d8f8cece8d1232dffe7f2 Author: Kristof Provost AuthorDate: 2026-05-07 09:58:17 +0000 Commit: Kristof Provost CommitDate: 2026-05-16 16:44:00 +0000 pfctl: relax interface name requirement The FreeBSD network stack, for better or worse, does not impose any requirements on interface names. As such it's valid for an interface name to start with a number (or indeed, be something like '⭐'). Allow this in pfctl, and add a test case for the specific case of interface names starting with a number. Note that we don't support UTF-8 names fully, so those may still fail. PR: 295064 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 4e7c1ff95a5187faee524055f22c4cf4134d1147) --- sbin/pfctl/parse.y | 2 +- tests/sys/netpfil/pf/names.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index c733a9496a59..aea30cb33481 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3764,7 +3764,7 @@ dynaddr : '(' STRING ')' { char *p, *op; op = $2; - if (!isalpha(op[0])) { + if (op[0] == '\0') { yyerror("invalid interface name '%s'", op); free(op); YYERROR; diff --git a/tests/sys/netpfil/pf/names.sh b/tests/sys/netpfil/pf/names.sh index e47b0917cfec..c6f2a06c15f9 100644 --- a/tests/sys/netpfil/pf/names.sh +++ b/tests/sys/netpfil/pf/names.sh @@ -95,8 +95,48 @@ group_cleanup() pft_cleanup } +atf_test_case "start_number" "cleanup" +start_number_head() +{ + atf_set descr 'Test interface names starting with a number' + atf_set require.user root +} + +start_number_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}b name 4ever + jexec alcatraz pfctl -e + + jexec alcatraz ifconfig + + pft_set_rules alcatraz \ + "block" \ + "pass in from any to (4ever)" + + atf_check -o ignore ping -c 3 192.0.2.2 + + # Negative test, if the interface doesn't exist we don't pass packets + pft_set_rules alcatraz \ + "block" \ + "pass in from any to (5ever)" + atf_check -s exit:2 -o ignore ping -c 1 -t 1 192.0.2.2 +} + +start_number_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "names" atf_add_test_case "group" + atf_add_test_case "start_number" }