From: Geliang Tang tanggeliang@kylinos.cn
v2: - update patch 6 only, fix errors reported by CI.
This patchset uses public helpers start_server_* and connect_to_* defined in network_helpers.c to drop duplicate code.
Geliang Tang (14): selftests/bpf: Add start_server_addr helper selftests/bpf: Use start_server_addr in cls_redirect selftests/bpf: Use connect_to_addr in cls_redirect selftests/bpf: Use start_server_addr in sk_assign selftests/bpf: Use connect_to_addr in sk_assign selftests/bpf: Use log_err in network_helpers selftests/bpf: Use start_server_addr in test_sock_addr selftests/bpf: Use connect_to_addr in test_sock_addr selftests/bpf: Add function pointer for __start_server selftests/bpf: Add start_server_setsockopt helper selftests/bpf: Use start_server_setsockopt in sockopt_inherit selftests/bpf: Use connect_to_fd in sockopt_inherit selftests/bpf: Use start_server_* in test_tcp_check_syncookie selftests/bpf: Use connect_to_addr in test_tcp_check_syncookie
tools/testing/selftests/bpf/Makefile | 4 +- tools/testing/selftests/bpf/network_helpers.c | 50 ++++++++---- tools/testing/selftests/bpf/network_helpers.h | 4 + .../selftests/bpf/prog_tests/cls_redirect.c | 38 +--------- .../selftests/bpf/prog_tests/sk_assign.c | 53 +------------ .../bpf/prog_tests/sockopt_inherit.c | 64 ++++------------ tools/testing/selftests/bpf/test_sock_addr.c | 74 ++---------------- .../bpf/test_tcp_check_syncookie_user.c | 76 +++---------------- 8 files changed, 83 insertions(+), 280 deletions(-)