diff options
| author | Martin KaFai Lau <[email protected]> | 2022-09-02 00:29:37 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2022-09-03 03:34:32 +0000 |
| commit | f649f992deeeab020257b886e054cc407154cbfc (patch) | |
| tree | 7a922ac6e0db46244b5f47744066af73b75adc2a /tools/testing/selftests/bpf/progs/bpf_tracing_net.h | |
| parent | bpf: Change bpf_getsockopt(SOL_IPV6) to reuse do_ipv6_getsockopt() (diff) | |
| download | kernel-f649f992deeeab020257b886e054cc407154cbfc.tar.gz kernel-f649f992deeeab020257b886e054cc407154cbfc.zip | |
selftest/bpf: Add test for bpf_getsockopt()
This patch removes the __bpf_getsockopt() which directly
reads the sk by using PTR_TO_BTF_ID. Instead, the test now directly
uses the kernel bpf helper bpf_getsockopt() which supports all
the required optname now.
TCP_SAVE[D]_SYN and TCP_MAXSEG are not tested in a loop for all
the hooks and sock_ops's cb. TCP_SAVE[D]_SYN only works
in passive connection. TCP_MAXSEG only works when
it is setsockopt before the connection is established and
the getsockopt return value can only be tested after
the connection is established.
Signed-off-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/bpf_tracing_net.h')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/bpf_tracing_net.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_tracing_net.h b/tools/testing/selftests/bpf/progs/bpf_tracing_net.h index 5ebc6dabef84..adb087aecc9e 100644 --- a/tools/testing/selftests/bpf/progs/bpf_tracing_net.h +++ b/tools/testing/selftests/bpf/progs/bpf_tracing_net.h @@ -38,6 +38,7 @@ #define TCP_USER_TIMEOUT 18 #define TCP_NOTSENT_LOWAT 25 #define TCP_SAVE_SYN 27 +#define TCP_SAVED_SYN 28 #define TCP_CA_NAME_MAX 16 #define TCP_NAGLE_OFF 1 |
