aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2024-01-12 13:15:42 +0000
committerKristof Provost <kp@FreeBSD.org>2024-01-15 13:02:02 +0000
commit24c0058a9b594bcc4f207924ca60d891c87fdfde (patch)
tree672c6526d43618016b2b9d93649f538d58367196
parent7cbaab712f98f868a1f069c00bdf705f77b06f6a (diff)
pf tests: test reassembly with dummynet
Ensure that if we pass packets through a dummynet pipe we still reassemble as expected. Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--tests/sys/netpfil/pf/fragmentation_pass.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh b/tests/sys/netpfil/pf/fragmentation_pass.sh
index 5e92bb2d9a97..737977bfd9cf 100644
--- a/tests/sys/netpfil/pf/fragmentation_pass.sh
+++ b/tests/sys/netpfil/pf/fragmentation_pass.sh
@@ -468,6 +468,44 @@ reassemble_slowpath_cleanup()
pft_cleanup
}
+atf_test_case "dummynet" "cleanup"
+dummynet_head()
+{
+ atf_set descr 'dummynet + reassembly test'
+ atf_set require.user root
+}
+
+dummynet_body()
+{
+ pft_init
+ dummynet_init
+
+ epair=$(vnet_mkepair)
+ vnet_mkjail alcatraz ${epair}a
+
+ ifconfig ${epair}b inet 192.0.2.1/24 up
+ jexec alcatraz ifconfig ${epair}a 192.0.2.2/24 up
+
+ # Sanity check
+ atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2
+
+ jexec alcatraz dnctl pipe 1 config bw 600Byte/s
+ jexec alcatraz dnctl pipe 2 config bw 700Byte/s
+
+ jexec alcatraz pfctl -e
+ pft_set_rules alcatraz \
+ "set reassemble yes" \
+ "block" \
+ "pass inet proto icmp all icmp-type echoreq dnpipe (1, 2)"
+
+ atf_check -s exit:0 -o ignore ping -s 2000 -c 1 192.0.2.2
+}
+
+dummynet_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "too_many_fragments"
@@ -479,4 +517,5 @@ atf_init_test_cases()
atf_add_test_case "reassemble"
atf_add_test_case "no_df"
atf_add_test_case "reassemble_slowpath"
+ atf_add_test_case "dummynet"
}