diff options
author | Andrey Ignatov <rdna@fb.com> | 2020-05-14 13:03:48 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-05-14 18:41:08 -0700 |
commit | 383724e17ab02d8e440def7792c4e151b13ef4d4 (patch) | |
tree | 10dec16b5626e4108805d9ae34a56e5f0f5c1aef /scripts/Makefile.dtbinst | |
parent | f307fa2cb4c935f7f1ff0aeb880c7b44fb9a642b (diff) |
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 'scripts/Makefile.dtbinst')
0 files changed, 0 insertions, 0 deletions