selftests/bpf: extend sockopt_sk selftest with TCP_CONGESTION use case
authorStanislav Fomichev <sdf@google.com>
Mon, 29 Jul 2019 21:51:11 +0000 (14:51 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 1 Aug 2019 20:55:52 +0000 (13:55 -0700)
commitfd5ef31f370a8b7000794cd8a428b349dbfbbb80
treeea5d70a8c8822f44c1d2bea45adc64769a6167d7
parent9babe825da769cfbd7080f95e6bddbe98ce6b95d
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>
tools/testing/selftests/bpf/progs/sockopt_sk.c
tools/testing/selftests/bpf/test_sockopt_sk.c