]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: add test for bpf_tcp_gen_syncookie
authorPetar Penkov <ppenkov@google.com>
Mon, 29 Jul 2019 16:59:18 +0000 (09:59 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 31 Jul 2019 04:03:05 +0000 (21:03 -0700)
commita961d928a27a03239beb4e4c2db6403ce47ec8e2
treeb268597b9de7c61cd2427727c2213d8d17998fe0
parent8f50271db79ccd7e89b59bf8d7c1c8c3116698fa
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>
tools/testing/selftests/bpf/progs/test_tcp_check_syncookie_kern.c
tools/testing/selftests/bpf/test_tcp_check_syncookie.sh
tools/testing/selftests/bpf/test_tcp_check_syncookie_user.c