From nobody Wed Feb 12 09:38:47 2025 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 4YtCtc4m5rz5mT92; Wed, 12 Feb 2025 09:38:48 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YtCtb6Xnmz3TtT; Wed, 12 Feb 2025 09:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739353127; 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=8NrDb8Xgwqw5IhiXbZjNh3wFZI8eVH6hSgaONulKg9Q=; b=lsr2wj3hGv6mpcbkbWxInmmO0JKi5nQSKRmfrexmy5pnZt9FQkrNPcNHXgg9rI7oOhmZWr E4MoP+C2/sPNlahfGbRPSXdPfhz8QhMrIeTE7VZ/vnE84jsJzk+Ra2KY0J+IiYlvZPHBrg E5NPAmVOzrheCgJypp+tuwMyrS2GAtBic6fT1nORzFsRffzgMa/wguX1TIzNrxhluqZqN0 Se9/G21VoW7E/53IcMxtwIVxSVYpAGqsFsMFH7rr3LaXuBVVoisHhDnilbvGXJxwAaMXgC vCTnDDdpO9LYEyqNUAd4oG74cPOGh6wJFJaGYRk4C8iJXZJ9gk9NwRlqChZ9xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739353127; 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=8NrDb8Xgwqw5IhiXbZjNh3wFZI8eVH6hSgaONulKg9Q=; b=BbvF0zfek4QYitjAvMmSkIO4AkxNUP3cV4jvPrH2eKBbdosJaxskZGLe0DNV1dhrwpUXib vEYNl6Yra8c6p4W8qEpjlwPImSyWNC78cQnfKAnnFKENe9tlMoGoz1j9L+gb5V6kXFVpp4 zdesK8w70d8sooqhr0Mk+8fxF3dUy0GcGE5e7Nq6xx1KVSfa9HyZLyK5B5q/KDgexjRK3U YPeCcl6Z4YouS7NAeEh3kuo/ksFToD/uq+uctVz3+/zGocXWehv073so/Vd4djkFQzfLWk V3zSWXcn0DH5ub6J4AQ0UuF50XW3FinLmUoWFi2w7cWzaiqbEJW9ead6kAmLCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739353127; a=rsa-sha256; cv=none; b=FjbQwH5nZH+x+MMtbO7Anpcp3xi9XFoRRVUkQGG8SaXQILibnxDU7sKX9s6PA3Jzjdq41N bbwJMrvgJVseMm7PqjlBtxde1lgFvq8c+QVcLxDtVjNJJofhQ5wSyBAt0bEnATgxa6GuAA d9VuNTdtiDZB66k/TDNf8gG+PahJ+ujQIeJMhQ/crW9iPEfQj3JaUZbWF2lcII0a8NYsOH 1bbndMTq3ZTsOKXH8uIB4FBygv1Ot/FZ5hFCl2MHeufrYPIRUDNXGsfIdUcmyr3XMgXzeB 5UdaoognZjIH7dKXLKyXSKqPF1IPzIqjSTq3JGLEv4rRjwSdsr4bB9OGB50vVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YtCtb68gTztV8; Wed, 12 Feb 2025 09:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51C9cljE037504; Wed, 12 Feb 2025 09:38:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51C9clg0037501; Wed, 12 Feb 2025 09:38:47 GMT (envelope-from git) Date: Wed, 12 Feb 2025 09:38:47 GMT Message-Id: <202502120938.51C9clg0037501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6c795ce1df47 - main - pf tests: verify that a nested anchor does not clear the quick flag 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 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/main X-Git-Reftype: branch X-Git-Commit: 6c795ce1df47e5fe9030c6c68abc38b48ff1769b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6c795ce1df47e5fe9030c6c68abc38b48ff1769b commit 6c795ce1df47e5fe9030c6c68abc38b48ff1769b Author: Kristof Provost AuthorDate: 2025-02-05 15:34:54 +0000 Commit: Kristof Provost CommitDate: 2025-02-12 08:29:09 +0000 pf tests: verify that a nested anchor does not clear the quick flag Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/anchor.sh | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 847f8d4f6dab..40e8354a2343 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -233,6 +233,51 @@ quick_cleanup() pft_cleanup } +atf_test_case "quick_nested" "cleanup" +quick_nested_head() +{ + atf_set descr 'Verify that a nested anchor does not clear quick' + atf_set require.user root +} + +quick_nested_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 \ + "anchor quick {\n\ + pass\n\ + anchor {\n\ + block proto tcp\n\ + }\n\ + }" \ + "block" + ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -sr -v + jexec alcatraz pfctl -ss -v + + # We can still ping because the anchor is 'quick' + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + jexec alcatraz pfctl -sr -v + jexec alcatraz pfctl -ss -v +} + +quick_nested_cleanup() +{ + pft_cleanup +} + atf_test_case "counter" "cleanup" counter_head() { @@ -279,5 +324,6 @@ atf_init_test_cases() atf_add_test_case "wildcard" atf_add_test_case "nested_label" atf_add_test_case "quick" + atf_add_test_case "quick_nested" atf_add_test_case "counter" }