bpf: selftests: Add connect_to_fd_opts to network_helpers
authorMartin KaFai Lau <kafai@fb.com>
Tue, 24 Aug 2021 17:30:19 +0000 (10:30 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 26 Aug 2021 00:40:35 +0000 (17:40 -0700)
commit3d7789831df9bda0941bda41cface6687b7c3e04
tree3f7c2b4f1a5f423c8035314d2a61993e90c9f463
parent700dcf0f447691f35abc7121f234457f90fcfb1c
bpf: selftests: Add connect_to_fd_opts to network_helpers

The next test requires to setsockopt(TCP_CONGESTION) before
connect(), so a new arg is needed for the connect_to_fd() to specify
the cc's name.

This patch adds a new "struct network_helper_opts" for the future
option needs.  It starts with the "cc" and "timeout_ms" option.
A new helper connect_to_fd_opts() is added to take the new
"const struct network_helper_opts *opts" as an arg.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210824173019.3977910-1-kafai@fb.com
tools/testing/selftests/bpf/network_helpers.c
tools/testing/selftests/bpf/network_helpers.h