From nobody Mon Aug 26 16:53:52 2024 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 4Wsxb43PXjz5TFLC; Mon, 26 Aug 2024 16:53:52 +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 4Wsxb42pjJz3ymt; Mon, 26 Aug 2024 16:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724691232; 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=jApDlPVEic+UkCyt/S8qv+E64vlB+tE6NjLN8HdBZCE=; b=IRRFkEnY5gGMJUpKzWuJNN5hcda8Od99pnA/kQ3t8wMc/3j9aQQk1MM035OFLAauEni3gk xEXVNT5wTuRPoLQYmzLgzITOgx1F2rD4oL7uQFRRuXLY1NIZtxZ/8lbXiMRwqK7gLi8xPk TneBRVsDuQ6fsnjGuPk8GmQ+BTh1bNjpCbwSipqmLsguhImzci7emIkoc2K1eGRYQf++Di J5xHZOj59sVTmzjLx05oE6Wvk5VYWkGIXKnjTwQp5x9vGhXcKBpy3Eauq7Dq3CZfZV0n+1 nHYtr+Hz82EdyohGuIj9cvTiW8Ia7bfwDJ5CJUoCv3ZqdAG7a5gnfgngUSpXPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724691232; a=rsa-sha256; cv=none; b=Jg9LdpaBumLk57GVt77IEscmPR0n9p3qH2IwpoFgHqRfec3CGj8Nip9VcotAFB9OpVAjvs CTOChIRxqlknwk0CCI5PgHKt+aPUAQooH9dZNIYZzP2wiMj56+vH3MCx40Uq80unG5rYhi uOZTGE6grUWj1VFuXgtXJYHfwY2ZfVQde6aliX3/XUX6RF/mdKHouP7ar+0Wm5vJ1KG0xx XPbmu0A0jewvr9+nog/6cr6Qgr+aXUDFaO5cYmGGrFVpQu5QuWK60iHRFCGmOYvv0Z99eP gO1IUwy2+j/SNX1/Udj3YyARbsH9SPhhjUUsddpcbm37HrtLybAjwQW1KFvwHA== 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=1724691232; 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=jApDlPVEic+UkCyt/S8qv+E64vlB+tE6NjLN8HdBZCE=; b=lysIlk3KRwN5Bb/TNS4YsV+/PSaGSdpH9GKcjBC1ghZ2Hbg9VBdIX52TPyyVBwN5NXZUdf 9MsZ9d4J4hc5+Ux85VGDdNwdAZ9Bu3ie5vxeLviM7j/7+sn1DEIATBAJxgrgAHR3bBtLe9 LWn5GvDfMdjdyNG0dx6+t7j4Z/R4uPiU9UOVq8Y99wa/4ott6Eqf3TliDrabEuTmBlx22N M9Ihl4Aj02jCRPuQ2lcZDsIjIQAfhunFmGwkVtjelONqMz4LLK0yHuuK9cr+iLfPPCYmIK kJ8ZysR7+v63k01T3HVNV847UwRWQQpgaFt/kjc7vpPSQ/Iowwqul1wmq8aUng== 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 4Wsxb42QHBzFSx; Mon, 26 Aug 2024 16:53:52 +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 47QGrqOR022320; Mon, 26 Aug 2024 16:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QGrqIR022317; Mon, 26 Aug 2024 16:53:52 GMT (envelope-from git) Date: Mon, 26 Aug 2024 16:53:52 GMT Message-Id: <202408261653.47QGrqIR022317@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: fff621251320 - main - pf tests: ensure that 'quick' on anchor rules works as expected 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: fff6212513205a4989b38e9debe455343a8d309f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fff6212513205a4989b38e9debe455343a8d309f commit fff6212513205a4989b38e9debe455343a8d309f Author: Kristof Provost AuthorDate: 2024-08-26 15:24:32 +0000 Commit: Kristof Provost CommitDate: 2024-08-26 16:50:02 +0000 pf tests: ensure that 'quick' on anchor rules works as expected Sponsored by: Rubicon Communications, LLC ("Netgate") --- 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 311d6485e794..25d9d5b6df03 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -195,6 +195,44 @@ nested_label_cleanup() pft_cleanup } +atf_test_case "quick" "cleanup" +quick_head() +{ + atf_set descr "Test handling of quick on anchors" + atf_set require.user root +} + +quick_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\ + }" \ + "block" + + # 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_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -202,4 +240,5 @@ atf_init_test_cases() atf_add_test_case "nested_anchor" atf_add_test_case "wildcard" atf_add_test_case "nested_label" + atf_add_test_case "quick" }