From nobody Sat May 16 16:44:49 2026 X-Original-To: dev-commits-src-branches@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 4gHqfn4TrXz6cgNT for ; Sat, 16 May 2026 16:44:49 +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 4gHqfn2CqYz3wpK for ; Sat, 16 May 2026 16:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778949889; 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=bqtVtaw0cqspcxMHvkN+uEWCk8QtwXWRDi3FxJU7ZCU=; b=XAgFqUOgg6+/iNwC5m3VvWCR79M1bfbYS2Bu5POsVmxZo50wBsoTvCLL+qe6JYPApaPSwZ eOV8yDKLr8Kn9dDF10RKOnyzpiNiR0Jvy93MLvh+AysbXuhCPzNh0iIaSdFx5AHavnZiH2 j+OJ90yghTCF4ThFNJxDiHC5DIrklQ3tqA3R7azAD63grzQBNMyeBXSLW4bJHcrV8edAYD /hf4ikv0ngVbPXTwWHnJ3IpHbgwb2IaVeODzS634HUdSHW3wVGgGHkExn1mgjM4J3jTmRs FzQPpUdFbzlsa2geMeuXxFCj6VLjn0VIPucuNV1ETaPDZXI/FX3A+Q1SsLuvSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778949889; a=rsa-sha256; cv=none; b=N6TGp4+VSfT3ojQNUaE7RZZAlG6R2Z0vSSxpI007RpYvbsMizCIpcD0O1mtBhFCtlafffO GNr+zo+BrYbZKD+cM+WgNtDTNoVJlK++c9MG580RthM+iRqQpkKm6pKoMR5rFdfEeneIHl /unbC7dPdGO6rtVe4gV/amWorXH1pH2l2cB3hGpFnZA3mZnCWvdQY97DRX56Q1LC+2l6cY 5w5dckXLhfBHRZO66m90I8uNN0jYqt3986sKsY8myB00UYsPftrk7pRPi7apjb4EKtZNJH QGtqR6M/Vn+4+AhmP9Wgl3+yuZzR99tb/u4MuNHK8DFU0eqTAagk+3HSpWKgug== 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=1778949889; 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=bqtVtaw0cqspcxMHvkN+uEWCk8QtwXWRDi3FxJU7ZCU=; b=GlZr0RSIyobMW+AqPgc0J/CsPDENRjn+yEvoUOd2zncj2iUe/W6buW9IeHsor+SOd3+dKT EMV5F3ucdbFR0JeaWRcrzhEGeKfLICfwatjW50DVbrocL7bQafY/K4FZh5mt6esoE6xDrY sT0FgbV5WQK/C4HA3dylKAtTt83A50zTC4KLHwA9NCTHM/YK91fdEGJJj6Js1cH5b5pJ61 iruc2ZWDaep+fwY7tjiS8nXFLbNq/MC19ZLKka94WMY75mQFGXetL9eAKzvh/QfcvVj07T l4HrjbrHLa5k0x1aJzxZVfgN+GmYvOGb01DKFGF3baUo3G1bq+7Z6xqN/T6L4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gHqfn1BkNz12Cd for ; Sat, 16 May 2026 16:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19089 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 16 May 2026 16:44:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e5536b061033 - stable/14 - pfctl: relax interface name requirement List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: e5536b061033bdc56cee7c1d42ab4fc17f5b8051 Auto-Submitted: auto-generated Date: Sat, 16 May 2026 16:44:49 +0000 Message-Id: <6a089f01.19089.5fbc9155@gitrepo.freebsd.org> The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5536b061033bdc56cee7c1d42ab4fc17f5b8051 commit e5536b061033bdc56cee7c1d42ab4fc17f5b8051 Author: Kristof Provost AuthorDate: 2026-05-07 09:58:17 +0000 Commit: Kristof Provost CommitDate: 2026-05-14 19:04:19 +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 58245ca642e0..df17486a5d45 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3728,7 +3728,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" }