summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/network_helpers.c
diff options
context:
space:
mode:
authorGeliang Tang <tanggeliang@kylinos.cn>2024-06-21 10:16:01 +0800
committerAlexei Starovoitov <ast@kernel.org>2024-06-20 20:42:44 -0700
commit7f0d5140a6d69d3e63467a220a2a1e0c9ec1463a (patch)
tree1b6d9748d6add216e90b6161136506fef998c3ba /tools/testing/selftests/bpf/network_helpers.c
parentbbca57aa378b43d25af2ec360b3e8bc4185d65cf (diff)
selftests/bpf: Drop noconnect from network_helper_opts
In test_bpf_ip_check_defrag_ok(), the new helper client_socket() can be used to replace connect_to_fd_opts() with "noconnect" opts, and the strcut member "noconnect" of network_helper_opts can be dropped now, always connect to server in connect_to_fd_opts(). Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Link: https://lore.kernel.org/r/f45760becce51986e4e08283c7df0f933eb0da14.1718932493.git.tanggeliang@kylinos.cn Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/network_helpers.c')
-rw-r--r--tools/testing/selftests/bpf/network_helpers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c
index 5f8214e2880d..44c2c8fa542a 100644
--- a/tools/testing/selftests/bpf/network_helpers.c
+++ b/tools/testing/selftests/bpf/network_helpers.c
@@ -318,9 +318,8 @@ int connect_to_addr(int type, const struct sockaddr_storage *addr, socklen_t add
return -1;
}
- if (!opts->noconnect)
- if (connect_fd_to_addr(fd, addr, addrlen, opts->must_fail))
- goto error_close;
+ if (connect_fd_to_addr(fd, addr, addrlen, opts->must_fail))
+ goto error_close;
return fd;