Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110664882
D31142.id92071.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31142.id92071.diff
View Options
Index: tests/sys/netpfil/pf/syncookie.sh
===================================================================
--- tests/sys/netpfil/pf/syncookie.sh
+++ tests/sys/netpfil/pf/syncookie.sh
@@ -27,6 +27,8 @@
. $(atf_get_srcdir)/utils.subr
+common_dir=$(atf_get_srcdir)/../common
+
atf_test_case "forward" "cleanup"
forward_head()
{
@@ -78,7 +80,54 @@
pft_cleanup
}
+atf_test_case "nostate" "cleanup"
+nostate_head()
+{
+ atf_set descr 'Ensure that we do not create until SYN|ACK'
+ atf_set require.user root
+ atf_set require.progs scapy
+}
+
+nostate_body()
+{
+ pft_init
+
+ epair=$(vnet_mkepair)
+ ifconfig ${epair}a 192.0.2.2/24 up
+
+ vnet_mkjail alcatraz ${epair}b
+ jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up
+
+ jexec alcatraz pfctl -e
+ pft_set_rules alcatraz \
+ "set syncookies always" \
+ "pass in" \
+ "pass out"
+
+ # Sanity check
+ atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1
+
+ # Now syn flood to create many states
+ ${common_dir}/pft_synflood.py \
+ --sendif ${epair}a \
+ --to 192.0.2.2 \
+ --count 20
+
+ states=$(jexec alcatraz pfctl -ss | grep tcp)
+ if [ -n "$states" ];
+ then
+ echo "$states"
+ atf_fail "Found unexpected state"
+ fi
+}
+
+nostate_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "forward"
+ atf_add_test_case "nostate"
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 3:47 PM (2 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16774304
Default Alt Text
D31142.id92071.diff (1 KB)
Attached To
Mode
D31142: pf tests: ensure syncookie does not create state
Attached
Detach File
Event Timeline
Log In to Comment