| /linux-6.15/tools/testing/selftests/bpf/prog_tests/ |
| H A D | mptcp.c | 85 int err, cfd = client_fd; in verify_tsk() 124 int err, cfd = client_fd; in verify_msk() 180 verify_tsk(map_fd, client_fd); in run_test() 182 close(client_fd); in run_test() 267 int server_fd, client_fd, err = 0; in run_mptcpify() local 293 send_byte(client_fd); in run_mptcpify() 297 close(client_fd); in run_mptcpify() 362 int server_fd, client_fd, err; in run_subflow() local 376 send_byte(client_fd); in run_subflow() 377 wait_for_new_subflows(client_fd); in run_subflow() [all …]
|
| H A D | sockopt_inherit.c | 44 int client_fd; in server_thread() local 60 client_fd = accept(fd, (struct sockaddr *)&addr, &len); in server_thread() 61 if (!ASSERT_GE(client_fd, 0, "accept client")) in server_thread() 64 err += verify_sockopt(client_fd, CUSTOM_INHERIT1, "accept", 1); in server_thread() 65 err += verify_sockopt(client_fd, CUSTOM_INHERIT2, "accept", 1); in server_thread() 66 err += verify_sockopt(client_fd, CUSTOM_LISTENER, "accept", 0); in server_thread() 68 close(client_fd); in server_thread() 98 int server_fd = -1, client_fd; in run_test() local 138 client_fd = connect_to_fd(server_fd, 0); in run_test() 139 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in run_test() [all …]
|
| H A D | cgroup_tcp_skb.c | 74 *client_fd = create_client_sock_v6(); in talk_to_cgroup() 75 if (!ASSERT_GE(*client_fd, 0, "client_fd")) in talk_to_cgroup() 89 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_cgroup() 98 cp = write(*client_fd, "hello", 5); in talk_to_cgroup() 127 *client_fd = create_client_sock_v6(); in talk_to_outside() 128 if (!ASSERT_GE(*client_fd, 0, "client_fd")) in talk_to_outside() 139 err = connect_fd_to_fd(*client_fd, *listen_fd, 0); in talk_to_outside() 145 cp = write(*client_fd, "hello", 5); in talk_to_outside() 239 int client_fd = -1, listen_fd = -1; in test_cgroup_tcp_skb() local 265 err = talk_to_cgroup(&client_fd, &listen_fd, &service_fd, skel); in test_cgroup_tcp_skb() [all …]
|
| H A D | tcp_rtt.c | 50 static int verify_sk(int map_fd, int client_fd, const char *msg, __u32 invoked, in verify_sk() argument 57 if (!ASSERT_GE(bpf_map_lookup_elem(map_fd, &client_fd, &val), 0, "read socket storage")) in verify_sk() 108 int client_fd; in run_test() local 126 client_fd = connect_to_fd(server_fd, 0); in run_test() 127 if (client_fd < 0) { in run_test() 132 err += verify_sk(map_fd, client_fd, "syn-ack", in run_test() 139 send_byte(client_fd); in run_test() 140 if (wait_for_ack(client_fd, 100) < 0) { in run_test() 146 err += verify_sk(map_fd, client_fd, "first payload byte", in run_test() 154 close(client_fd); in run_test()
|
| H A D | netns_cookie.c | 19 int server_fd = -1, client_fd = -1, cgroup_fd = -1; in test_netns_cookie() local 59 client_fd = connect_to_fd(server_fd, 0); in test_netns_cookie() 60 if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno)) in test_netns_cookie() 63 ret = send(client_fd, send_msg, sizeof(send_msg), 0); in test_netns_cookie() 68 &client_fd, &val); in test_netns_cookie() 72 err = getsockopt(client_fd, SOL_SOCKET, SO_NETNS_COOKIE, in test_netns_cookie() 80 &client_fd, &val); in test_netns_cookie() 97 if (client_fd != -1) in test_netns_cookie() 98 close(client_fd); in test_netns_cookie()
|
| H A D | socket_cookie.c | 18 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()
|
| H A D | ns_current_pid_tgid.c | 124 int verdict, map, server_fd = -1, client_fd = -1; in test_current_pid_tgid_sk_msg() local 155 client_fd = connect_to_fd(server_fd, 0); in test_current_pid_tgid_sk_msg() 156 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_current_pid_tgid_sk_msg() 159 err = bpf_map_update_elem(map, &key, &client_fd, BPF_ANY); in test_current_pid_tgid_sk_msg() 163 err = send(client_fd, send_msg, sizeof(send_msg), 0); in test_current_pid_tgid_sk_msg() 176 if (client_fd >= 0) in test_current_pid_tgid_sk_msg() 177 close(client_fd); in test_current_pid_tgid_sk_msg()
|
| H A D | load_bytes_relative.c | 12 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()
|
| H A D | sk_lookup.c | 380 err = send_byte(client_fd); in tcp_echo_test() 386 err = recv_byte(client_fd); in tcp_echo_test() 397 err = send_byte(client_fd); in udp_echo_test() 403 err = recv_byte(client_fd); in udp_echo_test() 595 close(client_fd); in run_lookup_prog() 804 int client_fd, server_fd, err; in drop_on_lookup() local 827 err = send_byte(client_fd); in drop_on_lookup() 840 close(client_fd); in drop_on_lookup() 1118 send_byte(client_fd); in run_sk_assign_connected() 1122 close(client_fd); in run_sk_assign_connected() [all …]
|
| H A D | cgroup_v1v2.c | 56 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local 62 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2() 63 if (!ASSERT_GE(client_fd, 0, "client_fd")) { in test_cgroup_v1v2() 67 close(client_fd); in test_cgroup_v1v2()
|
| H A D | xdp_synproxy.c | 60 int server_fd = -1, client_fd = -1, accept_fd = -1; in test_synproxy() local 135 client_fd = connect_to_fd(server_fd, 10000); in test_synproxy() 136 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_synproxy() 161 if (client_fd >= 0) in test_synproxy() 162 close(client_fd); in test_synproxy()
|
| H A D | bpf_nf.c | 53 int srv_fd = -1, client_fd = -1, srv_client_fd = -1; in test_bpf_nf_ct() local 83 client_fd = connect_to_server(srv_fd); in test_bpf_nf_ct() 84 if (!ASSERT_GE(client_fd, 0, "connect_to_server")) in test_bpf_nf_ct() 136 if (client_fd != -1) in test_bpf_nf_ct() 137 close(client_fd); in test_bpf_nf_ct()
|
| H A D | cgrp_local_storage.c | 87 int server_fd = 0, client_fd = 0, err = 0; in test_attach_cgroup() local 117 client_fd = connect_to_fd(server_fd, 0); in test_attach_cgroup() 118 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_attach_cgroup() 126 err = getsockname(client_fd, (struct sockaddr *)&addr, &addr_len); in test_attach_cgroup() 134 close(client_fd); in test_attach_cgroup()
|
| H A D | tc_redirect.c | 409 int listen_fd = -1, accept_fd = -1, client_fd = -1; in test_tcp() local 427 client_fd = connect_to_fd(listen_fd, TIMEOUT_MILLIS); in test_tcp() 428 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_tcp() 438 n = write(client_fd, buf, sizeof(buf)); in test_tcp() 452 if (client_fd >= 0) in test_tcp() 453 close(client_fd); in test_tcp() 660 if (!ASSERT_GE(client_fd, 0, "connect_to_fd")) in test_inet_dtime() 670 n = write(client_fd, buf, sizeof(buf)); in test_inet_dtime() 675 snd_tstamp(client_fd, buf, sizeof(buf)); in test_inet_dtime() 683 if (client_fd != -1) in test_inet_dtime() [all …]
|
| H A D | cg_storage_multi.c | 59 int server_fd = -1, client_fd = -1; in connect_send() local 70 client_fd = connect_to_fd(server_fd, 0); in connect_send() 71 if (client_fd < 0) in connect_send() 74 if (send(client_fd, &message, sizeof(message), 0) < 0) in connect_send() 83 close(client_fd); in connect_send()
|
| H A D | lsm_cgroup.c | 66 int listen_fd, client_fd, accepted_fd; in test_lsm_cgroup_functional() local 218 client_fd = connect_to_fd(listen_fd, 0); in test_lsm_cgroup_functional() 219 ASSERT_GE(client_fd, 0, "connect_to_fd"); in test_lsm_cgroup_functional() 266 close(client_fd); in test_lsm_cgroup_functional()
|
| /linux-6.15/tools/testing/selftests/net/ |
| H A D | bind_timewait.c | 45 int server_fd, client_fd, child_fd, ret; in create_timewait_socket() local 61 client_fd = socket(AF_INET, SOCK_STREAM, 0); in create_timewait_socket() 62 ASSERT_GT(client_fd, 0); in create_timewait_socket() 64 ret = connect(client_fd, (struct sockaddr *)&self->addr, self->addrlen); in create_timewait_socket() 72 close(client_fd); in create_timewait_socket()
|
| /linux-6.15/tools/testing/vsock/ |
| H A D | vsock_perf.c | 142 int client_fd; in run_receiver() local 179 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in run_receiver() 181 if (client_fd < 0) in run_receiver() 184 vsock_increase_buf_size(client_fd); in run_receiver() 186 if (setsockopt(client_fd, SOL_SOCKET, SO_RCVLOWAT, in run_receiver() 206 fds.fd = client_fd; in run_receiver() 250 close(client_fd); in run_receiver()
|
| H A D | util.c | 145 int client_fd; in vsock_bind_connect() local 147 client_fd = vsock_bind(VMADDR_CID_ANY, bind_port, type); in vsock_bind_connect() 149 if (vsock_connect_fd(client_fd, cid, port)) { in vsock_bind_connect() 154 return client_fd; in vsock_bind_connect() 217 int fd, client_fd, old_errno; in vsock_accept() local 225 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in vsock_accept() 227 } while (client_fd < 0 && errno == EINTR); in vsock_accept() 234 if (client_fd < 0) in vsock_accept() 235 return client_fd; in vsock_accept() 250 return client_fd; in vsock_accept()
|
| H A D | vsock_diag_test.c | 406 int client_fd; in test_connect_server() local 408 client_fd = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_connect_server() 409 if (client_fd < 0) { in test_connect_server() 417 st = find_vsock_stat(&sockets, client_fd); in test_connect_server() 423 close(client_fd); in test_connect_server()
|
| H A D | vsock_test.c | 1183 int listen_fd, client_fd, i; in test_double_bind_connect_server() local 1194 client_fd = accept(listen_fd, (struct sockaddr *)&sa_client, in test_double_bind_connect_server() 1197 } while (client_fd < 0 && errno == EINTR); in test_double_bind_connect_server() 1200 if (client_fd < 0) { in test_double_bind_connect_server() 1206 vsock_wait_remote_close(client_fd); in test_double_bind_connect_server() 1214 int i, client_fd; in test_double_bind_connect_client() local 1228 close(client_fd); in test_double_bind_connect_client() 1236 int client_fd; in test_unsent_bytes_server() local 1239 if (client_fd < 0) { in test_unsent_bytes_server() 1244 recv_buf(client_fd, buf, sizeof(buf), 0, sizeof(buf)); in test_unsent_bytes_server() [all …]
|
| /linux-6.15/tools/testing/selftests/landlock/ |
| H A D | net_test.c | 615 client_fd = bind_fd; in test_bind_and_connect() 618 client_fd = accept(bind_fd, NULL, 0); in test_bind_and_connect() 619 ASSERT_LE(0, client_fd); in test_bind_and_connect() 631 if (client_fd != bind_fd) in test_bind_and_connect() 632 EXPECT_LE(0, close(client_fd)); in test_bind_and_connect() 824 int bind_fd, client_fd, status; in TEST_F() local 909 client_fd = bind_fd; in TEST_F() 911 client_fd = accept(bind_fd, NULL, 0); in TEST_F() 912 ASSERT_LE(0, client_fd); in TEST_F() 920 if (client_fd != bind_fd) in TEST_F() [all …]
|
| /linux-6.15/tools/testing/selftests/drivers/net/hw/ |
| H A D | ncdevmem.c | 466 int client_fd; in do_server() local 519 client_fd = accept(socket_fd, &client_addr, &client_addr_len); in do_server() 541 ret = recvmsg(client_fd, &msg, MSG_SOCK_DEVMEM); in do_server() 608 ret = setsockopt(client_fd, SOL_SOCKET, in do_server() 629 close(client_fd); in do_server()
|
| /linux-6.15/fs/notify/fanotify/ |
| H A D | fanotify_user.c | 259 int client_fd; in create_fd() local 262 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); in create_fd() 263 if (client_fd < 0) in create_fd() 264 return client_fd; in create_fd() 273 put_unused_fd(client_fd); in create_fd() 274 client_fd = PTR_ERR(new_file); in create_fd() 279 return client_fd; in create_fd()
|
| /linux-6.15/tools/testing/selftests/bpf/ |
| H A D | network_helpers.h | 80 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
|