| /linux/tools/testing/selftests/bpf/prog_tests/ |
| 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 …]
|
| 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 …]
|
| A D | mptcp.c | 98 int err, cfd = client_fd; in verify_tsk() 137 int err, cfd = client_fd; in verify_msk() 169 int client_fd, prog_fd, map_fd, err; in run_test() local 186 client_fd = connect_to_fd(server_fd, 0); in run_test() 193 verify_tsk(map_fd, client_fd); in run_test() 195 close(client_fd); in run_test() 280 int server_fd, client_fd, err = 0; in run_mptcpify() local 300 client_fd = connect_to_fd(server_fd, 0); in run_mptcpify() 306 send_byte(client_fd); in run_mptcpify() 308 err = verify_mptcpify(server_fd, client_fd); in run_mptcpify() [all …]
|
| A D | netns_cookie.c | 15 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()
|
| 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()
|
| 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()
|
| 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()
|
| 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 …]
|
| 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()
|
| A D | cgroup_v1v2.c | 50 int server_fd, client_fd, cgroup_fd; in test_cgroup_v1v2() local 57 client_fd = connect_to_fd_opts(server_fd, &opts); in test_cgroup_v1v2() 58 if (!ASSERT_GE(client_fd, 0, "client_fd")) { in test_cgroup_v1v2() 62 close(client_fd); in test_cgroup_v1v2()
|
| 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()
|
| A D | bpf_nf.c | 53 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() 133 if (client_fd != -1) in test_bpf_nf_ct() 134 close(client_fd); in test_bpf_nf_ct()
|
| 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()
|
| 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 …]
|
| 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()
|
| A D | lsm_cgroup.c | 70 int listen_fd, client_fd, accepted_fd; in test_lsm_cgroup_functional() local 222 client_fd = connect_to_fd(listen_fd, 0); in test_lsm_cgroup_functional() 223 ASSERT_GE(client_fd, 0, "connect_to_fd"); in test_lsm_cgroup_functional() 270 close(client_fd); in test_lsm_cgroup_functional()
|
| /linux/tools/testing/selftests/net/ |
| 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()
|
| A D | ncdevmem.c | 258 int client_fd; in do_server() local 334 client_fd = accept(socket_fd, &client_addr, &client_addr_len); in do_server() 358 ret = recvmsg(client_fd, &msg, MSG_SOCK_DEVMEM); in do_server() 431 ret = setsockopt(client_fd, SOL_SOCKET, in do_server() 455 close(client_fd); in do_server()
|
| /linux/tools/testing/vsock/ |
| A D | util.c | 113 int client_fd, ret; in vsock_bind_connect() local 115 client_fd = socket(AF_VSOCK, type, 0); in vsock_bind_connect() 116 if (client_fd < 0) { in vsock_bind_connect() 121 if (bind(client_fd, (struct sockaddr *)&sa_client, sizeof(sa_client))) { in vsock_bind_connect() 138 return client_fd; in vsock_bind_connect() 237 int fd, client_fd, old_errno; in vsock_accept() local 245 client_fd = accept(fd, &clientaddr.sa, &clientaddr_len); in vsock_accept() 247 } while (client_fd < 0 && errno == EINTR); in vsock_accept() 254 if (client_fd < 0) in vsock_accept() 255 return client_fd; in vsock_accept() [all …]
|
| 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()
|
| 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()
|
| A D | vsock_test.c | 1194 int listen_fd, client_fd, i; in test_double_bind_connect_server() local 1205 client_fd = accept(listen_fd, (struct sockaddr *)&sa_client, in test_double_bind_connect_server() 1208 } while (client_fd < 0 && errno == EINTR); in test_double_bind_connect_server() 1211 if (client_fd < 0) { in test_double_bind_connect_server() 1217 vsock_wait_remote_close(client_fd); in test_double_bind_connect_server() 1225 int i, client_fd; in test_double_bind_connect_client() local 1239 close(client_fd); in test_double_bind_connect_client() 1247 int client_fd; in test_unsent_bytes_server() local 1250 if (client_fd < 0) { in test_unsent_bytes_server() 1255 recv_buf(client_fd, buf, sizeof(buf), 0, sizeof(buf)); in test_unsent_bytes_server() [all …]
|
| /linux/tools/testing/selftests/landlock/ |
| A D | net_test.c | 518 client_fd = bind_fd; in test_bind_and_connect() 521 client_fd = accept(bind_fd, NULL, 0); in test_bind_and_connect() 522 ASSERT_LE(0, client_fd); in test_bind_and_connect() 534 if (client_fd != bind_fd) in test_bind_and_connect() 535 EXPECT_LE(0, close(client_fd)); in test_bind_and_connect() 727 int bind_fd, client_fd, status; in TEST_F() local 812 client_fd = bind_fd; in TEST_F() 814 client_fd = accept(bind_fd, NULL, 0); in TEST_F() 815 ASSERT_LE(0, client_fd); in TEST_F() 823 if (client_fd != bind_fd) in TEST_F() [all …]
|
| /linux/fs/notify/fanotify/ |
| A D | fanotify_user.c | 254 int client_fd; in create_fd() local 257 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); in create_fd() 258 if (client_fd < 0) in create_fd() 259 return client_fd; in create_fd() 276 put_unused_fd(client_fd); in create_fd() 277 client_fd = PTR_ERR(new_file); in create_fd() 282 return client_fd; in create_fd()
|
| /linux/tools/testing/selftests/bpf/ |
| A D | network_helpers.h | 76 int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
|