summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/bpf_tcp_helpers.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2020-09-25 03:04:58 +0300
committerAlexei Starovoitov <ast@kernel.org>2020-09-25 23:58:02 +0300
commit9a856cae2217ca1bc0726417d32f3f1daf035389 (patch)
treeb37f9459a76aaaca81d41c0ce6ecd4bf9597a980 /tools/testing/selftests/bpf/bpf_tcp_helpers.h
parent0c402c6c3031fd6ba23c6a2433b9f804da093b20 (diff)
downloadlinux-9a856cae2217ca1bc0726417d32f3f1daf035389.tar.xz
bpf: selftest: Add test_btf_skc_cls_ingress
This patch attaches a classifier prog to the ingress filter. It exercises the following helpers with different socket pointer types in different logical branches: 1. bpf_sk_release() 2. bpf_sk_assign() 3. bpf_skc_to_tcp_request_sock(), bpf_skc_to_tcp_sock() 4. bpf_tcp_gen_syncookie, bpf_tcp_check_syncookie Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200925000458.3859627-1-kafai@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_tcp_helpers.h')
-rw-r--r--tools/testing/selftests/bpf/bpf_tcp_helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_tcp_helpers.h b/tools/testing/selftests/bpf/bpf_tcp_helpers.h
index a0e8b3758bd7..2915664c335d 100644
--- a/tools/testing/selftests/bpf/bpf_tcp_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_tcp_helpers.h
@@ -16,6 +16,7 @@ BPF_PROG(name, args)
struct sock_common {
unsigned char skc_state;
+ __u16 skc_num;
} __attribute__((preserve_access_index));
enum sk_pacing {
@@ -45,6 +46,10 @@ struct inet_connection_sock {
__u64 icsk_ca_priv[104 / sizeof(__u64)];
} __attribute__((preserve_access_index));
+struct request_sock {
+ struct sock_common __req_common;
+} __attribute__((preserve_access_index));
+
struct tcp_sock {
struct inet_connection_sock inet_conn;