diff options
author | Geliang Tang <geliang.tang@suse.com> | 2022-05-19 16:30:15 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-05-20 15:36:08 -0700 |
commit | ccc090f469000fd757049028eeb0dff43013f7c1 (patch) | |
tree | 2c49dbc78c86570fd271d88e06685d88d6c591d0 /tools/testing/selftests/bpf/bpf_tcp_helpers.h | |
parent | 0266223467728d553b99adea769d9ff3b6e41372 (diff) | |
download | linux-ccc090f469000fd757049028eeb0dff43013f7c1.tar.gz linux-ccc090f469000fd757049028eeb0dff43013f7c1.tar.bz2 linux-ccc090f469000fd757049028eeb0dff43013f7c1.zip |
selftests/bpf: Verify ca_name of struct mptcp_sock
This patch verifies another member of struct mptcp_sock, ca_name. Add a
new function get_msk_ca_name() to read the sysctl tcp_congestion_control
and verify it in verify_msk().
v3: Access the sysctl through the filesystem to avoid compatibility
issues with the busybox sysctl command.
v4: use ASSERT_* instead of CHECK_FAIL (Andrii)
v5: use ASSERT_STRNEQ() instead of strncmp() (Andrii)
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Link: https://lore.kernel.org/bpf/20220519233016.105670-7-mathew.j.martineau@linux.intel.com
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_tcp_helpers.h')
-rw-r--r-- | tools/testing/selftests/bpf/bpf_tcp_helpers.h | 5 |
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 422491872619..c38c66d5c1e6 100644 --- a/tools/testing/selftests/bpf/bpf_tcp_helpers.h +++ b/tools/testing/selftests/bpf/bpf_tcp_helpers.h @@ -16,6 +16,10 @@ BPF_PROG(name, args) #define SOL_TCP 6 #endif +#ifndef TCP_CA_NAME_MAX +#define TCP_CA_NAME_MAX 16 +#endif + #define tcp_jiffies32 ((__u32)bpf_jiffies64()) struct sock_common { @@ -230,6 +234,7 @@ struct mptcp_sock { struct inet_connection_sock sk; __u32 token; + char ca_name[TCP_CA_NAME_MAX]; } __attribute__((preserve_access_index)); #endif |