From owner-dev-commits-src-all@freebsd.org Fri May 7 15:26:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5305C6317A9; Fri, 7 May 2021 15:26:04 +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 4FcDmq6Lmnz4jl6; Fri, 7 May 2021 15:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3D2DD5AD4; Fri, 7 May 2021 15:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 147FPxhV026956; Fri, 7 May 2021 15:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 147FPxqp026955; Fri, 7 May 2021 15:25:59 GMT (envelope-from git) Date: Fri, 7 May 2021 15:25:59 GMT Message-Id: <202105071525.147FPxqp026955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: becdc0c0dc76 - stable/12 - pf tests: Test scrub fragment reassemble on interfaces with different MTU 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/stable/12 X-Git-Reftype: branch X-Git-Commit: becdc0c0dc7604389dd06b682ab11ed4dc43afea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 15:26:04 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=becdc0c0dc7604389dd06b682ab11ed4dc43afea commit becdc0c0dc7604389dd06b682ab11ed4dc43afea Author: Kristof Provost AuthorDate: 2021-04-27 16:46:03 +0000 Commit: Kristof Provost CommitDate: 2021-05-07 08:19:05 +0000 pf tests: Test scrub fragment reassemble on interfaces with different MTU There's a problem with pf's reassembly code where it produces incorrect checksums when reassembling across interfaces with different MTUs. Test this. PR: 255432 Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30013 (cherry picked from commit 388c0cde10293d9a3434e99146bf391aec6878a3) --- tests/sys/netpfil/pf/fragmentation.sh | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation.sh b/tests/sys/netpfil/pf/fragmentation.sh index 943c76e478f3..1be6a3bc17cd 100755 --- a/tests/sys/netpfil/pf/fragmentation.sh +++ b/tests/sys/netpfil/pf/fragmentation.sh @@ -116,8 +116,57 @@ v6_cleanup() pft_cleanup } +atf_test_case "mtu_diff" "cleanup" +mtu_diff_head() +{ + atf_set descr 'Test reassembly across different MTUs, PR #255432' + atf_set require.user root +} + +mtu_diff_body() +{ + pft_init + + epair_small=$(vnet_mkepair) + epair_large=$(vnet_mkepair) + + vnet_mkjail first ${epair_small}b ${epair_large}a + vnet_mkjail second ${epair_large}b + + ifconfig ${epair_small}a 192.0.2.1/25 up + jexec first ifconfig ${epair_small}b 192.0.2.2/25 up + + jexec first sysctl net.inet.ip.forwarding=1 + jexec first ifconfig ${epair_large}a 192.0.2.130/25 up + jexec first ifconfig ${epair_large}a mtu 9000 + jexec second ifconfig ${epair_large}b 192.0.2.131/25 up + jexec second ifconfig ${epair_large}b mtu 9000 + jexec second route add default 192.0.2.130 + + route add 192.0.2.128/25 192.0.2.2 + + jexec first pfctl -e + pft_set_rules first \ + "scrub all fragment reassemble" + + # Sanity checks + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.130 + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.131 + + # Large packet that'll get reassembled and sent out in one on the large + # epair + atf_check -s exit:0 -o ignore ping -c 1 -s 8000 192.0.2.131 +} + +mtu_diff_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" atf_add_test_case "v6" + atf_add_test_case "mtu_diff" }