From nobody Wed Sep 17 14:15:40 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 4cRglw66Ymz67SjQ; Wed, 17 Sep 2025 14:15:40 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cRglw4n3wz448C; Wed, 17 Sep 2025 14:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758118540; 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=7kpNpPo9G5Ln7iEvamLirM3DYLY/WZS03wRq3gDGLYo=; b=MYXTvKozqDd7bQ62gRTHNzuH4CZc0ipm3FMgeRzQqaJKuKTDYjb7PFk5TRQGw0ckrn5rRC Vv9QTvoz07R3FFPFwirhUOlI8lYJHVwvVsszdvyK3VcHAS1u8Z67ZUbYMUN8ihkQQNFX6Q 71fk9EiZwGVMzj10T9IaLWTcA2RC7g2lTW4lyX0qgPSLeD5PYuZyLtAgabetjBWGfm++uq x6YfWy8eQ9mebf7DrF/kPQ3ZMW7W6GQkcWqmkUqjl4nnhunH47YqC0f+Sjn3uLH6I6rTBi Hf/LRceM1n5WP5T+mndJDxOxBnCtoOXHR/InCMEDheCIF1wsAgYOuwuqN1PExw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758118540; 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=7kpNpPo9G5Ln7iEvamLirM3DYLY/WZS03wRq3gDGLYo=; b=czdT4aoyiZ7rKro+TtIPciLPQBEePwEVdWCyRhacBGTFtrcIIv6ncI9aH3od54oWrzurff 1b3XSA1dIZwpb18Ah9B2jroGxyGrLu9Z1CFg48i0iko5j0wgm5Q1kivLtU+URp/PcDa5Zt Pn5nxq3bO0OMrKw37wlXKGeWvQmtlIhEJvFW1c+XQmyX58Q+eVN+fNMJMjraajC/AgmlQh Z5ziBq0S40E+UvnoI4VpwD0JscslN2UAVRHJc6wdObIyXQZ01JFrLy3dJTGMdt98PjWSpM 81ERdEph/SNfR7CiDlrGqTsHbjceJtHf5s9QcaB1H+wGcKQTwgNLg2g5EMaG/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758118540; a=rsa-sha256; cv=none; b=Uqyh3O+rec0Jn03M2Epvqo0w2Lis5XXy3vE84sNwB5TVme2wQiALKV0g4FWaRy/0cWTgH/ NM5ZKDgTY78CUcyVwtIBdVLzQI8/fEsrOb+hJVJ+GbaV/qzc2quaG1aI21Z51LgMQnHzYo uQRPNymP2pXr6dolEUj3OSfMhEofQ+GQS5foLwC72GzUT6cCYupjKSqy5USdrvXmHm0FPB M8DQ75/Ek0+qNCcPUp/olsySZvNipzkLAqGsj0AWrEsbpfHZHnbBc6Vz9HVpXpDlXa/HCX tt97+RrVhZUV0cXWgkJlbIaZ94lmJTlTth9kTKANa6CTOBLMNzH6MxgEgdBqPw== 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 4cRglw4GXjzTTJ; Wed, 17 Sep 2025 14:15:40 +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 58HEFekI010177; Wed, 17 Sep 2025 14:15:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58HEFeG2010174; Wed, 17 Sep 2025 14:15:40 GMT (envelope-from git) Date: Wed, 17 Sep 2025 14:15:40 GMT Message-Id: <202509171415.58HEFeG2010174@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: 26c373aa367c - main - pf tests: declare a table inside an anchor 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: 26c373aa367c71394f0734af368974cafcf878d0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=26c373aa367c71394f0734af368974cafcf878d0 commit 26c373aa367c71394f0734af368974cafcf878d0 Author: Kristof Provost AuthorDate: 2025-08-22 15:34:29 +0000 Commit: Kristof Provost CommitDate: 2025-09-17 14:15:14 +0000 pf tests: declare a table inside an anchor Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/table.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 26fc5bf6cda2..69fe12fc9804 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -710,6 +710,43 @@ show_recursive_cleanup() pft_cleanup } +atf_test_case "in_anchor" "cleanup" +in_anchor_head() +{ + atf_set descr 'Test declaring tables in anchors' + atf_set require.user root +} + +in_anchor_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "block all" \ + "anchor \"foo\" {\n + table counters { 192.0.2.1 }\n + pass in from \n + }\n" + + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + + jexec alcatraz pfctl -sr -a "*" -vv + jexec alcatraz pfctl -sT -a "*" -vv +} + +in_anchor_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" @@ -727,4 +764,5 @@ atf_init_test_cases() atf_add_test_case "flush" atf_add_test_case "large" atf_add_test_case "show_recursive" + atf_add_test_case "in_anchor" }