diff options
author | Martin KaFai Lau <martin.lau@kernel.org> | 2022-09-01 17:29:12 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-02 20:34:31 -0700 |
commit | 65ddc82d3b96be5555a36de4e2b4547433a00532 (patch) | |
tree | 7dcd433ef37e4ef8a9a5a85bc5c2d8861858595c /ipc | |
parent | c2b063ca34586758dcfd76e12696a71a1df849a0 (diff) |
bpf: Change bpf_getsockopt(SOL_SOCKET) to reuse sk_getsockopt()
This patch changes bpf_getsockopt(SOL_SOCKET) to reuse
sk_getsockopt(). It removes all duplicated code from
bpf_getsockopt(SOL_SOCKET).
Before this patch, there were some optnames available to
bpf_setsockopt(SOL_SOCKET) but missing in bpf_getsockopt(SOL_SOCKET).
It surprises users from time to time. For example, SO_REUSEADDR,
SO_KEEPALIVE, SO_RCVLOWAT, and SO_MAX_PACING_RATE. This patch
automatically closes this gap without duplicating more code.
The only exception is SO_BINDTODEVICE because it needs to acquire a
blocking lock. Thus, SO_BINDTODEVICE is not supported.
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20220902002912.2894040-1-kafai@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions