From nobody Mon Jan 15 13:04:25 2024 X-Original-To: dev-commits-src-main@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 4TDC5j5pHhz56v1h; Mon, 15 Jan 2024 13:04:25 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDC5j3qnTz4Vc2; Mon, 15 Jan 2024 13:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323865; 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=y9HnDnlcDkzvLuIAmc7ZkiqKzDvZhZkE4uHNsamaAu0=; b=K/HodA8HpG+qTpOxquUFZGXykx/HbtwIY5gUtDnKMSQU4GmaLB2xYWQQIf7VmHqsz8bkpf gs0jhca8L2nj/hih+29SbS8myfvJxUfscG0yXj0tzVQDMMAvqD3bVbhYD2IfJ1vfkl53G1 ITkyO8ep54QHKNhPNn8Ds+m8QK9zz66TUUXxc1tpKgshIPV1771/TYBaEJoD63EkBJhZ5B i6USsB/r9jLKvYOFRZTqt5qRnhKBdbTpLZKd78o7GLzzbDFqUz+zuGPBtQVUYVKI6xo3CN lidPpF28NJ+9MtR8n0mKSaX9KDjytObrGmwY/uIbwZTkkvLI5M55vJoKLDa+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705323865; 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=y9HnDnlcDkzvLuIAmc7ZkiqKzDvZhZkE4uHNsamaAu0=; b=Ys0Rgdbv1+mu2xWjwBzgxPBdUfQ1W7J9f+2xM32NJ7pxk+U9aUl10fnebScd1RWRuSeOc6 qwb8Q3pxd0edhi/PoT6A8rVF9Tkzv9IZ7kvrsUEpr3XzwQolrN+flCcfhlDYUPc9S2noK3 UBP57kjjQQdueE5JhWZ7Ll86FnefHVagpg4Oa8dQM3MhirwJLO7hxIGlrm7qQZf9juMRtU kkWXczuNqBDQ4zIxzQFqvVDZnyCQRjpdCpGjfwosgnCWTgiAK9ktMzuNTYFKqihTq6qEhS dMzvSSdE4Koh4ZlKBFxKYwHOX1so0JPaYUR96S9tiRpSzUOWwsS++aw5H272hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705323865; a=rsa-sha256; cv=none; b=EnqMiegzS83AHID1e3QVHF3i3/7nqxMkxGvrtfkjCU0g+8ifgbpMhoS92819t1YZRjiMyg Y6QTTumsNBy+NAG9UtmLALsLNasVK+Dnn9tZfV7aOA1/mvO/3AUg8pmjJClemG+p9L7WNk VyV4z1JoCToIpeqb3Mwx19500GGBYEGZ89RxBkD5F3MADNQ21CfgZNCS/WMupBlUofR726 8CXyt2pgLCl67wHVfhhMQl7KvoEUUlZ2kaBcF1npZG3T4ymAj5BZLcPuR269pLaW/a7wzi MujKg9J+wckkmhTksCkSFL49XqMuGahrDpgtVDKcVUBB05VTEYJ/1GdyQLDAmg== 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 4TDC5j220Szy6w; Mon, 15 Jan 2024 13:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40FD4P5U074942; Mon, 15 Jan 2024 13:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40FD4PLl074939; Mon, 15 Jan 2024 13:04:25 GMT (envelope-from git) Date: Mon, 15 Jan 2024 13:04:25 GMT Message-Id: <202401151304.40FD4PLl074939@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: 3f9a6e0b85d4 - main - pf tests: dummynet + nat fragmentation test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 3f9a6e0b85d418b49b3a3b859b9992e407cb66d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3f9a6e0b85d418b49b3a3b859b9992e407cb66d5 commit 3f9a6e0b85d418b49b3a3b859b9992e407cb66d5 Author: Kristof Provost AuthorDate: 2024-01-12 16:09:52 +0000 Commit: Kristof Provost CommitDate: 2024-01-15 13:02:02 +0000 pf tests: dummynet + nat fragmentation test Ensure that we do the right thing when we reassemble fragmented packet and send it through a dummynet pipe. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/fragmentation_pass.sh | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh b/tests/sys/netpfil/pf/fragmentation_pass.sh index 737977bfd9cf..d505accba5f2 100644 --- a/tests/sys/netpfil/pf/fragmentation_pass.sh +++ b/tests/sys/netpfil/pf/fragmentation_pass.sh @@ -506,6 +506,53 @@ dummynet_cleanup() pft_cleanup } +atf_test_case "dummynet_nat" "cleanup" +dummynet_nat_head() +{ + atf_set descr 'Test dummynet on NATed fragmented traffic' + atf_set require.user root +} + +dummynet_nat_body() +{ + pft_init + dummynet_init + + epair_one=$(vnet_mkepair) + ifconfig ${epair_one}a 192.0.2.1/24 up + + epair_two=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair_one}b ${epair_two}a + jexec alcatraz ifconfig ${epair_one}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_two}a 198.51.100.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + vnet_mkjail singsing ${epair_two}b + jexec singsing ifconfig ${epair_two}b 198.51.100.2/24 up + jexec singsing route add default 198.51.100.1 + + route add 198.51.100.0/24 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config bw 1600Byte/s + jexec alcatraz dnctl pipe 2 config bw 1700Byte/s + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set reassemble yes" \ + "nat on ${epair_two}a from 192.0.2.0/24 -> (${epair_two}a)" \ + "block in" \ + "pass in inet proto icmp all icmp-type echoreq dnpipe (1, 2)" + + atf_check -s exit:0 -o ignore ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore ping -c 1 -s 2000 198.51.100.2 +} + +dummynet_nat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" @@ -518,4 +565,5 @@ atf_init_test_cases() atf_add_test_case "no_df" atf_add_test_case "reassemble_slowpath" atf_add_test_case "dummynet" + atf_add_test_case "dummynet_nat" }