]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests/bpf: Test case for BPF_SOCK_OPS_TCP_LISTEN_CB
authorAndrey Ignatov <rdna@fb.com>
Thu, 12 Jul 2018 00:33:37 +0000 (17:33 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 14 Jul 2018 22:08:41 +0000 (00:08 +0200)
commit78d8e26d46bc2ed73ab6a0e369a342478fda4ce0
treeea6113284a1b646adc567632117e76a14b0f920d
parent2044e4ef0be29f0154b078a956a3d8331315298a
selftests/bpf: Test case for BPF_SOCK_OPS_TCP_LISTEN_CB

Cover new TCP-BPF callback in test_tcpbpf: when listen() is called on
socket, set BPF_SOCK_OPS_STATE_CB_FLAG so that BPF_SOCK_OPS_STATE_CB
callback can be called on future state transition, and when such a
transition happens (TCP_LISTEN -> TCP_CLOSE), track it in the map and
verify it in user space later.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_tcpbpf.h
tools/testing/selftests/bpf/test_tcpbpf_kern.c
tools/testing/selftests/bpf/test_tcpbpf_user.c