From nobody Mon Sep 16 13:05:26 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 4X6lWq3zRCz5Vy0Z; Mon, 16 Sep 2024 13:05:27 +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 4X6lWq0J5Wz54Pl; Mon, 16 Sep 2024 13:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726491927; 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=mgu9C7tO72fe9+Tb3xMtyCWDWLcWFkkLCMkKsW77yyM=; b=HK4LDhxMglCcTh4KOHKCGHsZFugACXeYfbnRBT8JaKSydY3iAVnX1cPv4A3FKjC5envyGX HY4h2gNptvRNkJftFBwGcB31xNK5cubLHVe4tYYiWyTJ99s52o3iY+jen+koxhYxE5lJtG IZGZtSGBz/X8BQnznYCUrRxbKSzUj8Rl29gfDNaMtG4+RnDd4Z2boD9dsWoSirC4cmSTO7 4bfhdiZSL9Ql6dFuAybFfy5U4M9b2offM4Xx0aDQYFPxZ+a/HESSAS6svxaxWuQCdNib/M 0pqCSRgWUUvCv20adExZbPkJGSsl3PEQ/eRxpvI0Gy+b9y+vPuaMk8481YzBsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726491927; a=rsa-sha256; cv=none; b=rIvDHvbcBorOXV/aevRLKOXJLH5rjGnovSCuGyYO+Dh1+4HIlqg3VWG0HWPnNsf7Hdv9Ce PRs1VZVgaSKpgNmq1rM6sQv1fWx4VPied/5pgAQcqMDlaOmjBXq/awi8hYMX6PM6T1fpfH d8gQQNZkYnaWMbiRDrfFtUg8rDHugfRX7uX7/XlRT05/VcF2gYPO4F+hPeoZlZqYcmFfHY LNgdotIASpD4eA71iz0MVXCk+WGbKY7uSqBQmT1tOmK+WQwYVKzp9bHsKUYDahQPFa/ikv juHoC7pTAU4ZQ/0t3hjGXuJWWTkcEdC8SO9FCuStShng13VBm7YrgTgpSW+4rA== 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=1726491927; 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=mgu9C7tO72fe9+Tb3xMtyCWDWLcWFkkLCMkKsW77yyM=; b=bj70yMJsXdPulFrTRcq7Sc26Ph9phX4J7A6+fJOMyq0U6T7kXjl/Hzi7hXt/fcEy217jZL jurkreZ1Q13HEEN8lI+68o93QFJbGnkxTxcdfsaF8KoS52AakernRDehuAJYot8OsSVqqE bqD80dmorfHDdk+81yyxD2JmXutr+kxnhNDWXjsipC6b+3ELPSaklS9ad2h40yNaj8CaxV vU93bixHxM814rBi2K4fGdYpnkEQYY4cWiohqmeqMT0iFQrNIUfhXls3k0ESW728XPMUkF cyY0GmpcFM0claB6nnL8wqyKyVfx12uvbTnbclMrCVyW/1oTK997kyoJxvoXMg== 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 4X6lWp6zNCzwVl; Mon, 16 Sep 2024 13:05:26 +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 48GD5QGw020884; Mon, 16 Sep 2024 13:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48GD5Qrl020881; Mon, 16 Sep 2024 13:05:26 GMT (envelope-from git) Date: Mon, 16 Sep 2024 13:05:26 GMT Message-Id: <202409161305.48GD5Qrl020881@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: 357c95ea4663 - main - pf tests: ensure we correctly optimize { any, 192.0.2.3 } 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: 357c95ea4663225803e6f1fa89499286a018eb89 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=357c95ea4663225803e6f1fa89499286a018eb89 commit 357c95ea4663225803e6f1fa89499286a018eb89 Author: Kristof Provost AuthorDate: 2024-08-29 10:03:49 +0000 Commit: Kristof Provost CommitDate: 2024-09-16 11:48:54 +0000 pf tests: ensure we correctly optimize { any, 192.0.2.3 } Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46581 --- tests/sys/netpfil/pf/pass_block.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index 36218d8e673f..abd303bae6e6 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -373,6 +373,41 @@ received_on_cleanup() pft_cleanup } +atf_test_case "optimize_any" "cleanup" +optimize_any_head() +{ + atf_set descr 'Test known optimizer bug' + atf_set require.user root +} + +optimize_any_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 -t 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "pass in inet from { any, 192.0.2.3 }" + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 +} + +optimize_any_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "enable_disable" @@ -382,4 +417,5 @@ atf_init_test_cases() atf_add_test_case "nested_inline" atf_add_test_case "urpf" atf_add_test_case "received_on" + atf_add_test_case "optimize_any" }