From nobody Wed Jan 14 08:06:07 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 4drdwb2cm4z6PL6m for ; Wed, 14 Jan 2026 08:06:07 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4drdwb1jLlz3KFf for ; Wed, 14 Jan 2026 08:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768377967; 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=X4Hwqm88U63dDEcrIj3oPpee4B/tS7Uuc/6vdFwgh9A=; b=L975HbguC3LuDH6OVCDJpRl1CLLbZBFoolo+MIo8cpRpERgamwx0emdhye2/4V3ZZZMhnK Di932YWa5zn1rrcjyfgEtK18pWw2ed6IegxCXJ8gwF2KzZix95YIMnc0HNSiQsgtqYL0GE dqt9fnv6jI4O+8Je7TQpeUfA5MQyeaAGXEzLxJK3wpSu7FTReDQxfvuXvNVzOjX1MY29tl rEAikrRFEZr7kHa30L1H2JhgAokB/EM9mCCEJs6pCj8MszWDNWuZRIJpkgZEqDHRl+Mp6B oFJoDGVrdlJknH4OU/9WWyzUHu/69otDWamgjdLBh0zxsapp2Yfv/Vd/goax3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768377967; 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=X4Hwqm88U63dDEcrIj3oPpee4B/tS7Uuc/6vdFwgh9A=; b=dd2dS81Z01tVHybAnybkTZyn22GS7ichrTFDfUsO9ta6IPW/c53phlQCZW+nDeVyY907jc Ewb+egmt5FdJn43ZH+Q/ZgOvCoC/JkqQZGb0Is3NaSHtJrIC5LfUR5Qj4zwCPjbK+WjC/D tSxMhZAS9BnDTaEzdY4FQ0qvc7MUKfaZiezfRMW3iSLfKfmlLYePnpkgbnVnU/jArOKXMP 6FEE/S6kf9jVa34nwtoFmzAXXtiIQus1JweDgJvqGS+jIFgYVy4ibuZJZf02ikP/Hr54GW diwgAzj4zfjMl/MTP/ayNOPFiU5gjzh6co9xf0vV+t9q/qtk87VUHNShCjRd2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768377967; a=rsa-sha256; cv=none; b=cbcgZ/j9wiL0Q/xpuBzbiQnv1Ay3E3iNiitveXC6uIrClEvCwCpOp9QIdx1c1r0fiDBTPo zzEUnUAOMD5utminEOKgjlU2zz/H7PTIv3MM30ZsNExqHjnrWfT2L8jN7JOeZvvAOyPBPD pDsZgiwRjKA/iNMEwlaYdmYluII7ACNIcKEKiD3G5T43OZktLHxiapPk82bHFqzkY/dbpq eoyhPZ3omuGVaIGupOfIBj6g8ZkPjUm6Nf7kBY6chCthi6dZK11Eou8d22IMbbXxgGDWa6 P791HoVi5Pp//UE+gOLvs+wmlTWo+lRy5Y2/qp/DWWjpeYcJTUUx7cr21sdjKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4drdwb1Ghgzq5F for ; Wed, 14 Jan 2026 08:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id cc27 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 14 Jan 2026 08:06:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 086a3cb4b850 - main - pf tests: basic source limiters test case 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: 086a3cb4b850184448f0f127ddd8f875a3070164 Auto-Submitted: auto-generated Date: Wed, 14 Jan 2026 08:06:07 +0000 Message-Id: <69674e6f.cc27.5b744674@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=086a3cb4b850184448f0f127ddd8f875a3070164 commit 086a3cb4b850184448f0f127ddd8f875a3070164 Author: Kristof Provost AuthorDate: 2026-01-07 17:06:55 +0000 Commit: Kristof Provost CommitDate: 2026-01-14 06:44:41 +0000 pf tests: basic source limiters test case Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/limiters.sh | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/sys/netpfil/pf/limiters.sh b/tests/sys/netpfil/pf/limiters.sh index 17a66ed12c5e..3f70c8e79caa 100644 --- a/tests/sys/netpfil/pf/limiters.sh +++ b/tests/sys/netpfil/pf/limiters.sh @@ -130,8 +130,66 @@ state_rate_cleanup() pft_cleanup } +atf_test_case "source_basic" "cleanup" +source_basic_head() +{ + atf_set descr 'Basic source limiter test' + atf_set require.user root +} + +source_basic_body() +{ + pft_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.2/24 up + ifconfig ${epair}a inet alias 192.0.2.3/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 -S 192.0.2.2 -c 1 192.0.2.1 + atf_check -s exit:0 -o ignore \ + ping -S 192.0.2.3 -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + + # Allow up to one source for ICMP. + pft_set_rules alcatraz \ + "set timeout icmp.error 120" \ + "source limiter \"server\" id 1 entries 128 limit 1" \ + "block in proto icmp" \ + "pass in proto icmp source limiter \"server\"" + + atf_check -s exit:0 -o ignore \ + ping -S 192.0.2.2 -c 2 192.0.2.1 + + # This should now fail + atf_check -s exit:2 -o ignore \ + ping -S 192.0.2.2 -c 2 192.0.2.1 + + jexec alcatraz pfctl -sLimiterSrcs + hardlim=$(jexec alcatraz pfctl -sLimiterSrcs | awk 'NR>1 { print $5; }') + if [ $hardlim -eq 0 ]; then + atf_fail "Hard limit not incremented" + fi + + # However, a different source will succeed + atf_check -s exit:0 -o ignore \ + ping -S 192.0.2.3 -c 2 192.0.2.1 +} + +source_basic_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "state_basic" atf_add_test_case "state_rate" + atf_add_test_case "source_basic" }