selftests/bpf: extend sockopt_sk selftest with TCP_CONGESTION use case

Ignore SOL_TCP:TCP_CONGESTION in getsockopt and always override
SOL_TCP:TCP_CONGESTION with "cubic" in setsockopt hook.

Call setsockopt(SOL_TCP, TCP_CONGESTION) with short optval ("nv")
to make sure BPF program has enough buffer space to replace it
with "cubic".

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Stanislav Fomichev 2019-07-29 14:51:11 -07:00 • committed by Alexei Starovoitov
commit fd5ef31f37
2 changed files with 47 additions and 0 deletions