]> 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)
commitb906a53dc7c5642539e5a59f441a857af4c26363
treeb268597b9de7c61cd2427727c2213d8d17998fe0
parentf73d3866512eed743d92e0c7d8e944aa1ac8528e
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