/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | btf_skc_cls_ingress.c | 76 int listen_fd = -1, cli_fd = -1, srv_fd = -1, err; in test_conn() local 98 srv_fd = accept(listen_fd, NULL, NULL); in test_conn() 99 if (CHECK_FAIL(srv_fd == -1)) in test_conn() 124 if (srv_fd != -1) in test_conn() 125 close(srv_fd); in test_conn() 130 int listen_fd = -1, cli_fd = -1, srv_fd = -1, err; in test_syncookie() local 153 srv_fd = accept(listen_fd, NULL, NULL); in test_syncookie() 154 if (CHECK_FAIL(srv_fd == -1)) in test_syncookie() 184 if (srv_fd != -1) in test_syncookie() 185 close(srv_fd); in test_syncookie()
|
H A D | bpf_nf.c | 34 static int connect_to_server(int srv_fd) in connect_to_server() argument 42 if (!ASSERT_EQ(connect_fd_to_fd(fd, srv_fd, TIMEOUT_MS), 0, "connect_fd_to_fd")) { in connect_to_server() 53 int srv_fd = -1, client_fd = -1, srv_client_fd = -1; in test_bpf_nf_ct() local 76 srv_fd = start_server(AF_INET, SOCK_STREAM, "127.0.0.1", srv_port, TIMEOUT_MS); in test_bpf_nf_ct() 77 if (!ASSERT_GE(srv_fd, 0, "start_server")) in test_bpf_nf_ct() 80 client_fd = connect_to_server(srv_fd); in test_bpf_nf_ct() 85 srv_client_fd = accept(srv_fd, (struct sockaddr *)&peer_addr, &len); in test_bpf_nf_ct() 130 if (srv_fd != -1) in test_bpf_nf_ct() 131 close(srv_fd); in test_bpf_nf_ct()
|
H A D | ip_check_defrag.c | 175 int srv_fd = -1; in test_bpf_ip_check_defrag_ok() local 193 srv_fd = start_server(ipv6 ? AF_INET6 : AF_INET, SOCK_DGRAM, NULL, SERVER_PORT, 0); in test_bpf_ip_check_defrag_ok() 195 if (!ASSERT_GE(srv_fd, 0, "start_server")) in test_bpf_ip_check_defrag_ok() 202 client_tx_fd = connect_to_fd_opts(srv_fd, &tx_ops); in test_bpf_ip_check_defrag_ok() 211 client_rx_fd = connect_to_fd_opts(srv_fd, &rx_opts); in test_bpf_ip_check_defrag_ok() 254 len = recvfrom(srv_fd, buf, sizeof(buf), 0, (struct sockaddr *)&caddr, &caddr_len); in test_bpf_ip_check_defrag_ok() 257 len = sendto(srv_fd, buf, len, 0, (struct sockaddr *)&caddr, caddr_len); in test_bpf_ip_check_defrag_ok() 271 if (srv_fd != -1) in test_bpf_ip_check_defrag_ok() 272 close(srv_fd); in test_bpf_ip_check_defrag_ok()
|
H A D | tcp_hdr_options.c | 36 int srv_fd; member 69 close(sk_fds->srv_fd); in sk_fds_close() 97 sk_fds->srv_fd = start_server(AF_INET6, SOCK_STREAM, LO_ADDR6, 0, 0); in sk_fds_connect() 98 if (!ASSERT_NEQ(sk_fds->srv_fd, -1, "start_server")) in sk_fds_connect() 102 sk_fds->active_fd = fastopen_connect(sk_fds->srv_fd, fast, in sk_fds_connect() 105 sk_fds->active_fd = connect_to_fd(sk_fds->srv_fd, 0); in sk_fds_connect() 108 close(sk_fds->srv_fd); in sk_fds_connect() 113 if (!ASSERT_OK(getsockname(sk_fds->srv_fd, (struct sockaddr *)&addr6, in sk_fds_connect() 124 sk_fds->passive_fd = accept(sk_fds->srv_fd, NULL, 0); in sk_fds_connect() 143 close(sk_fds->srv_fd); in sk_fds_connect()
|
H A D | bpf_tcp_ca.c | 262 int err, lfd = -1, cli_fd = -1, srv_fd = -1; in test_dctcp_fallback() local 291 srv_fd = accept(lfd, NULL, 0); in test_dctcp_fallback() 292 if (!ASSERT_GE(srv_fd, 0, "srv_fd")) in test_dctcp_fallback() 301 err = getsockopt(srv_fd, SOL_TCP, TCP_CONGESTION, srv_cc, &cc_len); in test_dctcp_fallback() 311 if (srv_fd != -1) in test_dctcp_fallback() 312 close(srv_fd); in test_dctcp_fallback()
|
H A D | tc_redirect.c | 477 int opt = 1, srv_fd = -1, cli_fd = -1, nretries = 0, err, n; in wait_netstamp_needed_key() local 486 srv_fd = start_server(AF_INET6, SOCK_DGRAM, "::1", 0, 0); in wait_netstamp_needed_key() 487 if (!ASSERT_GE(srv_fd, 0, "start_server")) in wait_netstamp_needed_key() 490 err = setsockopt(srv_fd, SOL_SOCKET, SO_TIMESTAMPNS, in wait_netstamp_needed_key() 495 cli_fd = connect_to_fd(srv_fd, TIMEOUT_MILLIS); in wait_netstamp_needed_key() 503 err = __rcv_tstamp(srv_fd, buf, sizeof(buf), &tstamp); in wait_netstamp_needed_key() 513 if (!tstamp && srv_fd != -1) { in wait_netstamp_needed_key() 514 close(srv_fd); in wait_netstamp_needed_key() 515 srv_fd = -1; in wait_netstamp_needed_key() 520 return srv_fd; in wait_netstamp_needed_key()
|
H A D | select_reuseport.c | 399 int nev, srv_fd, cli_fd; in do_test() local 428 srv_fd = sk_fds[ev.data.u32]; in do_test() 430 int new_fd = accept(srv_fd, NULL, 0); in do_test() 444 nread = recv(srv_fd, &rcv_cmd, sizeof(rcv_cmd), MSG_DONTWAIT); in do_test()
|