From nobody Fri Apr 17 11:55:42 2026 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 4fxtcZ5QfBz6ZdVV for ; Fri, 17 Apr 2026 11:55:42 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcZ1VkTz470m for ; Fri, 17 Apr 2026 11:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426942; 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=vLBNVRUaoASW/MDTs3shPjziPQfu+XiRBiwEzE8l7hs=; b=yr7GMOIvW+QuaKVMetSnZUQdsBeK6gR58+62n8/BkOuW2s7oC59bWvhB3D2XAr4FTlVaYI +5rbfhjVX+aa7ICWdCD4M3zPbp1EdbeZQSyf3hmINyhWS97FkLZAHrwTdsmbvCXkuZZwDV GukQnm83BlqZ8ZYlGCEHIRBucfdIsywMRbtFO5l2GcRqK4Qws9qgs9ejx5rYeIrIwh43Fy Ty7uWzMPNHP2IvdWNL129AcK4ULEAo+D1aPiEue6JdsD1pOnDejQM7J380w/eYb+sV4Sxm cG8E9PclVcCZW4AXgVEZoifmq9waDkcFhUeNWXHUniiGj0O5cU4O8V8PNIDG6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426942; a=rsa-sha256; cv=none; b=HT6ukgJeC+IsPCcGYzyvBneXqiK4ohqxXuJl75fcPoIHX/qUQScTaXuEjCb/ACBB4TFq64 vIq7+cRIUJVHyj7CucZGP965lsK5bxyD6Q2U8YGmQpLVkGP0VvtCQ9L14rlCOix2MbZ6+s qfhnyhMr1RL8xnv5hbnJgGhKvrntzy6cZ9u6F2aMp7EYQEWJ3maCIUOp+FAkc+9tzjxViq 3YYGqnqTIoAojT2H5m8A34mZfdwatK8WdNwW40XdB8jsGwIlHEIgszWlmOf+rzgp2z3FU8 7VFnAMZtlAKw905yrh0MFU6WvehqcmQOSs84Xu7PmDKT6zPvSFuMe7OvZEOqyg== 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=1776426942; 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=vLBNVRUaoASW/MDTs3shPjziPQfu+XiRBiwEzE8l7hs=; b=X3rxOLbkQifFNO3Sg1AbhDyH/y2rkEkARh9wlB/4y3qx7Kyo/UJ93Aj6l5/p2ia+JoniFd BVi8avMLK7xE4RA+/LR6K34M69E0feVioud/lP6OUSYznDUm2hjEgdZ+XdkrhslzqWWYNF YrD0mEv70Lhw6PddPRUvMRaMQGuTFOFPJTi3EO7q4uCENztvmv7TuVVOXN58SDcTekmGaB /jmKTmZrdWgJHT2b1eesjmAzOCYXdLo7HPFnjkTNJUSk7Pm9Gxn0+OEFjhF0LQPckq2Q4h RZkyKDiuvsWgzfYW5SdcwaePIaKHd6GbCHDS9cVos/y3hWU7Zj5bOgeupQyfnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcZ0XJszssB for ; Fri, 17 Apr 2026 11:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 397d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 95fe1ba5579d - main - pf tests: test having multiple state limiters 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: 95fe1ba5579df2fe204ad30d892160966677ae98 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:42 +0000 Message-Id: <69e21fbe.397d2.7d823b5d@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=95fe1ba5579df2fe204ad30d892160966677ae98 commit 95fe1ba5579df2fe204ad30d892160966677ae98 Author: Kristof Provost AuthorDate: 2026-04-16 13:46:59 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:06 +0000 pf tests: test having multiple state limiters Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/limiters.sh | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/sys/netpfil/pf/limiters.sh b/tests/sys/netpfil/pf/limiters.sh index 8d9a199db787..f576955e5640 100644 --- a/tests/sys/netpfil/pf/limiters.sh +++ b/tests/sys/netpfil/pf/limiters.sh @@ -185,6 +185,56 @@ state_block_cleanup() pft_cleanup } +atf_test_case "state_multiple" "cleanup" +state_multiple_head() +{ + atf_set descr 'Create multiple state limiters' + atf_set require.user root +} + +state_multiple_body() +{ + pft_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 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 + # Allow up to one ICMP state. + pft_set_rules alcatraz \ + "set timeout icmp.error 120" \ + "state limiter \"server\" id 1 limit 1" \ + "state limiter \"client\" id 2 limit 1" \ + "block in proto icmp" \ + "pass in proto icmp state limiter \"server\" (no-match)" + + atf_check -s exit:0 -o ignore \ + ping -c 2 192.0.2.1 + + # This should now fail + atf_check -s exit:2 -o ignore \ + ping -c 2 192.0.2.1 + + jexec alcatraz pfctl -sLimiterStates + hardlim=$(jexec alcatraz pfctl -sLimiterStates | awk 'NR>1 { print $5; }') + if [ $hardlim -eq 0 ]; then + atf_fail "Hard limit not incremented" + fi +} + +state_multiple_cleanup() +{ + pft_cleanup +} + atf_test_case "source_basic" "cleanup" source_basic_head() { @@ -261,5 +311,6 @@ atf_init_test_cases() atf_add_test_case "state_basic" atf_add_test_case "state_rate" atf_add_test_case "state_block" + atf_add_test_case "state_multiple" atf_add_test_case "source_basic" }