selftests/bpf: add tests for bpf_tcp_check_syncookie and bpf_skc_lookup_tcp
authorLorenz Bauer <lmb@cloudflare.com>
Fri, 22 Mar 2019 01:54:06 +0000 (09:54 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 22 Mar 2019 01:59:11 +0000 (18:59 -0700)
commitbafc0ba8261e36e36b0b1e851749fd3712a2a6f4
tree7121a9eaa84868932fd2b124ac432e4424d17eeb
parent5792d52df1e77110abf0d11b1131992a8c0c8d17
selftests/bpf: add tests for bpf_tcp_check_syncookie and bpf_skc_lookup_tcp

Add tests which verify that the new helpers work for both IPv4 and
IPv6, by forcing SYN cookies to always on. Use a new network namespace
to avoid clobbering the global SYN cookie settings.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/bpf_helpers.h
tools/testing/selftests/bpf/progs/test_tcp_check_syncookie_kern.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_tcp_check_syncookie.sh [new file with mode: 0755]
tools/testing/selftests/bpf/test_tcp_check_syncookie_user.c [new file with mode: 0644]