Home
last modified time | relevance | path

Searched refs:client_fd (Results 1 – 18 of 18) sorted by relevance

/Linux-v6.1/tools/testing/selftests/bpf/prog_tests/
Dsockopt_inherit.c70 int client_fd; in server_thread() local
86 client_fd = accept(fd, (struct sockaddr *)&addr, &len); in server_thread()
87 if (!ASSERT_GE(client_fd, 0, "accept client")) in server_thread()
90 err += verify_sockopt(client_fd, CUSTOM_INHERIT1, "accept", 1); in server_thread()
91 err += verify_sockopt(client_fd, CUSTOM_INHERIT2, "accept", 1); in server_thread()
92 err += verify_sockopt(client_fd, CUSTOM_LISTENER, "accept", 0); in server_thread()
94 close(client_fd); in server_thread()
167 int server_fd = -1, client_fd; in run_test() local
202 client_fd = connect_to_server(server_fd); in run_test()
203 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in run_test()
[all …]
Dnetns_cookie.c15 int server_fd = -1, client_fd = -1, cgroup_fd = -1; in test_netns_cookie() local
45 client_fd = connect_to_fd(server_fd, 0); in test_netns_cookie()
46 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_netns_cookie()
49 ret = send(client_fd, send_msg, sizeof(send_msg), 0); in test_netns_cookie()
54 &client_fd, &val); in test_netns_cookie()
58 err = getsockopt(client_fd, SOL_SOCKET, SO_NETNS_COOKIE, in test_netns_cookie()
66 &client_fd, &val); in test_netns_cookie()
75 if (client_fd != -1) in test_netns_cookie()
76 close(client_fd); in test_netns_cookie()
Dtcp_rtt.c46 static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 invoked, in verify_sk() argument
53 if (!ASSERT_GE(bpf_map_lookup_elem(map_fd, &client_fd, &val), 0, "read socket storage")) in verify_sk()
93 int client_fd; in run_test() local
111 client_fd = connect_to_fd(server_fd, 0); in run_test()
112 if (client_fd < 0) { in run_test()
117 err += verify_sk(map_fd, client_fd, "syn-ack", in run_test()
124 send_byte(client_fd); in run_test()
125 if (wait_for_ack(client_fd, 100) < 0) { in run_test()
131 err += verify_sk(map_fd, client_fd, "first payload byte", in run_test()
139 close(client_fd); in run_test()
Dmptcp.c23 static int verify_tsk(int map_fd, int client_fd) in verify_tsk() argument
25 int err, cfd = client_fd; in verify_tsk()
61 static int verify_msk(int map_fd, int client_fd, __u32 token) in verify_msk() argument
64 int err, cfd = client_fd; in verify_msk()
96 int client_fd, prog_fd, map_fd, err; in run_test() local
123 client_fd = connect_to_fd(server_fd, 0); in run_test()
124 if (!ASSERT_GE(client_fd, 0, "connect to fd")) { in run_test()
129 err += is_mptcp ? verify_msk(map_fd, client_fd, sock_skel->bss->token) : in run_test()
130 verify_tsk(map_fd, client_fd); in run_test()
132 close(client_fd); in run_test()
Dsocket_cookie.c18 int server_fd = 0, client_fd = 0, cgroup_fd = 0, err = 0; in test_socket_cookie() local
52 client_fd = connect_to_fd(server_fd, 0); in test_socket_cookie()
53 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_socket_cookie()
57 &client_fd, &val); in test_socket_cookie()
61 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); in test_socket_cookie()
69 close(client_fd); in test_socket_cookie()
Dload_bytes_relative.c12 int server_fd, cgroup_fd, prog_fd, map_fd, client_fd; in test_load_bytes_relative() local
52 client_fd = connect_to_fd(server_fd, 0); in test_load_bytes_relative()
53 if (CHECK_FAIL(client_fd < 0)) in test_load_bytes_relative()
55 close(client_fd); in test_load_bytes_relative()
Dcgroup_v1v2.c48 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local
55 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2()
56 if (!ASSERT_GE(client_fd, 0, "client_fd")) { in test_cgroup_v1v2()
60 close(client_fd); in test_cgroup_v1v2()
Dsk_lookup.c436 static int tcp_echo_test(int client_fd, int server_fd) in tcp_echo_test() argument
440 err = send_byte(client_fd); in tcp_echo_test()
446 err = recv_byte(client_fd); in tcp_echo_test()
453 static int udp_echo_test(int client_fd, int server_fd) in udp_echo_test() argument
457 err = send_byte(client_fd); in udp_echo_test()
463 err = recv_byte(client_fd); in udp_echo_test()
601 int client_fd, reuse_conn_fd = -1; in run_lookup_prog() local
651 client_fd = make_client(t->sotype, t->connect_to.ip, t->connect_to.port); in run_lookup_prog()
652 if (client_fd < 0) in run_lookup_prog()
656 tcp_echo_test(client_fd, server_fds[t->accept_on]); in run_lookup_prog()
[all …]
Dxdp_synproxy.c65 int server_fd = -1, client_fd = -1, accept_fd = -1; in test_synproxy() local
140 client_fd = connect_to_fd(server_fd, 10000); in test_synproxy()
141 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_synproxy()
166 if (client_fd >= 0) in test_synproxy()
167 close(client_fd); in test_synproxy()
Dbpf_nf.c53 int srv_fd = -1, client_fd = -1, srv_client_fd = -1; in test_bpf_nf_ct() local
80 client_fd = connect_to_server(srv_fd); in test_bpf_nf_ct()
81 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in test_bpf_nf_ct()
128 if (client_fd != -1) in test_bpf_nf_ct()
129 close(client_fd); in test_bpf_nf_ct()
Dtc_redirect.c284 int listen_fd = -1, accept_fd = -1, client_fd = -1; in test_tcp() local
302 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_tcp()
303 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_tcp()
313 n = write(client_fd, buf, sizeof(buf)); in test_tcp()
327 if (client_fd >= 0) in test_tcp()
328 close(client_fd); in test_tcp()
440 int opt = 1, accept_fd = -1, client_fd = -1, listen_fd, err; in test_inet_dtime() local
472 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_inet_dtime()
475 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_inet_dtime()
485 n = write(client_fd, buf, sizeof(buf)); in test_inet_dtime()
[all …]
Dcg_storage_multi.c60 int server_fd = -1, client_fd = -1; in connect_send() local
69 client_fd = connect_to_fd(server_fd, 0); in connect_send()
70 if (client_fd < 0) in connect_send()
73 if (send(client_fd, "message", strlen("message"), 0) < 0) in connect_send()
79 close(client_fd); in connect_send()
Dlsm_cgroup.c69 int listen_fd, client_fd, accepted_fd; in test_lsm_cgroup_functional() local
219 client_fd = connect_to_fd(listen_fd, 0); in test_lsm_cgroup_functional()
220 ASSERT_GE(client_fd, 0, "connect_to_fd"); in test_lsm_cgroup_functional()
260 close(client_fd); in test_lsm_cgroup_functional()
/Linux-v6.1/tools/testing/vsock/
Dutil.c155 int client_fd; in vsock_accept() local
174 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in vsock_accept()
176 } while (client_fd < 0 && errno == EINTR); in vsock_accept()
183 if (client_fd < 0) in vsock_accept()
184 return client_fd; in vsock_accept()
199 return client_fd; in vsock_accept()
Dvsock_diag_test.c404 int client_fd; in test_connect_server() local
406 client_fd = vsock_stream_accept(VMADDR_CID_ANY, 1234, NULL); in test_connect_server()
407 if (client_fd < 0) { in test_connect_server()
415 st = find_vsock_stat(&sockets, client_fd); in test_connect_server()
421 close(client_fd); in test_connect_server()
/Linux-v6.1/tools/testing/selftests/bpf/
Dnetwork_helpers.c323 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms) in connect_fd_to_fd() argument
328 if (settimeo(client_fd, timeout_ms)) in connect_fd_to_fd()
336 if (connect_fd_to_addr(client_fd, &addr, len, false)) in connect_fd_to_fd()
Dnetwork_helpers.h53 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
/Linux-v6.1/fs/notify/fanotify/
Dfanotify_user.c255 int client_fd; in create_fd() local
258 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); in create_fd()
259 if (client_fd < 0) in create_fd()
260 return client_fd; in create_fd()
277 put_unused_fd(client_fd); in create_fd()
278 client_fd = PTR_ERR(new_file); in create_fd()
283 return client_fd; in create_fd()