diff options
author | Kristof Provost <kp@FreeBSD.org> | 2024-11-20 16:26:55 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2024-12-17 10:07:16 +0000 |
commit | e128e988a26a2c439da6920a5d5839b961542285 (patch) | |
tree | 55fbabd30b4206776a565548e37f74931ad3d5a3 | |
parent | 7cae58a449559e7dca179129a37d971379d4e2c2 (diff) |
pf tests: check packet reassembly with nat64
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D47805
-rw-r--r-- | tests/sys/netpfil/pf/nat64.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 0ae2c0399daf..9e91e95570c1 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -52,6 +52,7 @@ nat64_setup() jexec rtr pfctl -e pft_set_rules rtr \ + "set reassemble yes" \ "set state-policy if-bound" \ "pass in on ${epair}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" } @@ -82,6 +83,33 @@ icmp_echo_cleanup() pft_cleanup } +atf_test_case "fragmentation" "cleanup" +fragmentation_head() +{ + atf_set descr 'Test fragmented packets' + atf_set require.user root +} + +fragmentation_body() +{ + nat64_setup + + atf_check -s exit:0 -o ignore \ + ping6 -c 1 -s 1280 64:ff9b::192.0.2.2 + + atf_check -s exit:0 \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ + ping6 -c 3 -s 2000 64:ff9b::192.0.2.2 + atf_check -s exit:0 \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ + ping6 -c 3 -s 10000 -b 20000 64:ff9b::192.0.2.2 +} + +fragmentation_cleanup() +{ + pft_cleanup +} + atf_test_case "tcp" "cleanup" tcp_head() { @@ -178,6 +206,7 @@ sctp_cleanup() atf_init_test_cases() { atf_add_test_case "icmp_echo" + atf_add_test_case "fragmentation" atf_add_test_case "tcp" atf_add_test_case "udp" atf_add_test_case "sctp" |