aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
diff options
context:
space:
mode:
authorAndrey Ignatov <rdna@fb.com>2020-05-14 13:03:48 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-05-14 18:41:08 -0700
commit383724e17ab02d8e440def7792c4e151b13ef4d4 (patch)
tree10dec16b5626e4108805d9ae34a56e5f0f5c1aef /tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
parentbpf: Introduce bpf_sk_{, ancestor_}cgroup_id helpers (diff)
downloadwireguard-linux-383724e17ab02d8e440def7792c4e151b13ef4d4.tar.xz
wireguard-linux-383724e17ab02d8e440def7792c4e151b13ef4d4.zip
selftests/bpf: Add connect_fd_to_fd, connect_wait net helpers
Add two new network helpers. connect_fd_to_fd connects an already created client socket fd to address of server fd. Sometimes it's useful to separate client socket creation and connecting this socket to a server, e.g. if client socket has to be created in a cgroup different from that of server cgroup. Additionally connect_to_fd is now implemented using connect_fd_to_fd, both helpers don't treat EINPROGRESS as an error and let caller decide how to proceed with it. connect_wait is a helper to work with non-blocking client sockets so that if connect_to_fd or connect_fd_to_fd returned -1 with errno == EINPROGRESS, caller can wait for connect to finish or for connection timeout. The helper returns -1 on error, 0 on timeout (1sec, hard-coded), and positive number on success. Signed-off-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/1403fab72300f379ca97ead4820ae43eac4414ef.1589486450.git.rdna@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c')
0 files changed, 0 insertions, 0 deletions