summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
diff options
context:
space:
mode:
authorPetar Penkov <ppenkov@google.com>2019-07-29 19:59:18 +0300
committerAlexei Starovoitov <ast@kernel.org>2019-07-31 07:03:05 +0300
commit91bc35789db4e1a489be7ab6e318e6265202e096 (patch)
treeb268597b9de7c61cd2427727c2213d8d17998fe0 /tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
parent637f71c09ba22d1042f5b48b58c249ee5665d44d (diff)
downloadlinux-91bc35789db4e1a489be7ab6e318e6265202e096.tar.xz
selftests/bpf: add test for bpf_tcp_gen_syncookie
Modify the existing bpf_tcp_check_syncookie test to also generate a SYN cookie, pass the packet to the kernel, and verify that the two cookies are the same (and both valid). Since cloned SKBs are skipped during generic XDP, this test does not issue a SYN cookie when run in XDP mode. We therefore only check that a valid SYN cookie was issued at the TC hook. Additionally, verify that the MSS for that SYN cookie is within expected range. Signed-off-by: Petar Penkov <ppenkov@google.com> Reviewed-by: Lorenz Bauer <lmb@cloudflare.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_tcp_check_syncookie.sh')
-rwxr-xr-xtools/testing/selftests/bpf/test_tcp_check_syncookie.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh b/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
index d48e51716d19..9b3617d770a5 100755
--- a/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
+++ b/tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
@@ -37,6 +37,9 @@ setup()
ns1_exec ip link set lo up
ns1_exec sysctl -w net.ipv4.tcp_syncookies=2
+ ns1_exec sysctl -w net.ipv4.tcp_window_scaling=0
+ ns1_exec sysctl -w net.ipv4.tcp_timestamps=0
+ ns1_exec sysctl -w net.ipv4.tcp_sack=0
wait_for_ip 127.0.0.1
wait_for_ip ::1