From nobody Thu Sep 15 08:48:38 2022 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 4MSrTL4HZCz4cXQF; Thu, 15 Sep 2022 08:48:38 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MSrTL3h5Qz3Tkd; Thu, 15 Sep 2022 08:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663231718; 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=s4u1ZDC/Um3CN1WVuTvMM2rzSwRPdpFZnYeVVbjqZw8=; b=p/ZzFRqJL5d0KYAkCoNgksuzzWjKgj+cFbd5kkJ1mr2JXxPmMqyyxvHixpLF0qn10kTM2d sE8a3OtvFpJmDC2pSbezKDx0JSubHkZd20R7tkx2YQmckoW8FBMmTXYfGj/CptXCrRXF7Z A54FD0ZJMZJRGCFMr1GO9XohvVu1G5ZNLTlozS82FChud5dYn5p7wkKA0k75ILhJ3z6Hh+ TCQ9BE5Yh7Yh2u/ZMLg4eh4B7O2KfeJP/FJ5yPaeHQPWRRbJs9oSOkfYkUppY8CsPu+x9r MafRrx7wPLfZOto6a4XUlcYylnzEsSv6P90A/DqelTrzDi5UJETcni4S3SExPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MSrTL2dVbzyC3; Thu, 15 Sep 2022 08:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28F8mc8b063069; Thu, 15 Sep 2022 08:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28F8mcQ4063068; Thu, 15 Sep 2022 08:48:38 GMT (envelope-from git) Date: Thu, 15 Sep 2022 08:48:38 GMT Message-Id: <202209150848.28F8mcQ4063068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 15d30ce3fa94 - stable/13 - pf tests: test wildcard anchors 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/13 X-Git-Reftype: branch X-Git-Commit: 15d30ce3fa9478520da79123f25709aae0f9bf17 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663231718; 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=s4u1ZDC/Um3CN1WVuTvMM2rzSwRPdpFZnYeVVbjqZw8=; b=nvG1mbeNGKafZdp3E4P9SBtYp8jjDhXCcuxX5oEpw6P4rug25gdXxeLP55AkkvB9Ou3uLi zZCx8iQFS+Gz9asHMznDCcVH1HfyH1wlONU2qiPdHiOP3BAD7MiZ+Ty3sPYVRWkCHqiOHq fdbu1yyxUE7yzPSYy2EaGEATkrB9txMfvSsa3I1BUyil6nUBNUykMTWhuq+5NY2+D/kuOi noVw38XU4jldBFQhu72k9gZikdnQcw0s2cogmY7axAC+4GbGBckB++I9N0ctEGSnUVtLmU yRlFS8mjTVa6Vk6d8LJa6F80xvOHtx4R6FUtDHLPjHsOwL7uQuIxVsqDfqPEYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663231718; a=rsa-sha256; cv=none; b=LT+AXx8V3XGmTWTxM6z0DJII7uQpC7OaKxyuWc7r4INoyB/foOgLoDf+0EjkxLvDTMfVdn AZEafgVkHXYD6rnq7rf0hMat5gUzU6jrz4FJrtjfT2kI453gH/GT9cA9De3siv3ufg2z0N /UNwwb5K9qAIlC4sHDOGvboh+oMplC8eaIdg8QIaZ5ykjkq25w03HYZ/VnvxTI5OO9osy0 SmkvFXGfPMQPOJfAEuoETuLQ8XiDUKzU4YZkyj2YbggJGE6BK2WGsRVD///IP4fZeQ5ceZ EVNlZ0bP+ZZsFdMtSeZEq6vuL9Hi2Dyy6VHwqq+zSoyW6wLX1VwhaR19il+z3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=15d30ce3fa9478520da79123f25709aae0f9bf17 commit 15d30ce3fa9478520da79123f25709aae0f9bf17 Author: Kristof Provost AuthorDate: 2022-08-31 13:40:33 +0000 Commit: Kristof Provost CommitDate: 2022-09-15 08:48:13 +0000 pf tests: test wildcard anchors Ensure that a wildcard anchor actually includes any nested anchors (i.e. foo/* will call into foo/bar). MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D36414 (cherry picked from commit d5a0bf4517c053803b266742d16be456c5393ae7) --- tests/sys/netpfil/pf/anchor.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 4fd3697155d9..27903d469507 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -93,8 +93,47 @@ nested_anchor_cleanup() pft_cleanup } +atf_test_case "wildcard" "cleanup" +wildcard_head() +{ + atf_set descr 'Test wildcard anchors for functionality' + atf_set require.user root +} + +wildcard_body() +{ + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo/*\"" + + atf_check -s exit:2 -o ignore ping -c 1 192.0.2.1 + + echo "pass" | jexec alcatraz pfctl -g -f - -a "foo/bar" + + jexec alcatraz pfctl -sr -a "*" + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 +} + +wildcard_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" atf_add_test_case "nested_anchor" + atf_add_test_case "wildcard" }