diff options
author | Martin KaFai Lau <kafai@fb.com> | 2022-08-16 23:18:04 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-08-18 17:06:13 -0700 |
commit | 29003875bd5bab262a29d1c6e76a2124bd07e4c2 (patch) | |
tree | 4dd0e5a07b181664d68234b0613bcf78be41681b /tools/testing/selftests/bpf/prog_tests/skb_load_bytes.c | |
parent | ebf9e8e653667e834372e9435217a7bf33bec7a0 (diff) |
bpf: Change bpf_setsockopt(SOL_SOCKET) to reuse sk_setsockopt()
After the prep work in the previous patches,
this patch removes most of the dup code from bpf_setsockopt(SOL_SOCKET)
and reuses them from sk_setsockopt().
The sock ptr test is added to the SO_RCVLOWAT because
the sk->sk_socket could be NULL in some of the bpf hooks.
The existing optname white-list is refactored into a new
function sol_socket_setsockopt().
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/20220817061804.4178920-1-kafai@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/skb_load_bytes.c')
0 files changed, 0 insertions, 0 deletions