diff options
| author | Michal Luczaj <mhal@rbox.co> | 2025-06-11 21:56:50 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-17 14:50:27 -0700 |
| commit | d56a8dbff8fea1c644183e52a39b165757f7b151 (patch) | |
| tree | 05494e557ef8e5c4754bd4093c74ae9c736acd9b /tools/testing/vsock/util.h | |
| parent | 0f0decc777d7ed4d7ba316a5f92495e38c6fc6b1 (diff) | |
| download | linux-next-d56a8dbff8fea1c644183e52a39b165757f7b151.tar.gz linux-next-d56a8dbff8fea1c644183e52a39b165757f7b151.zip | |
vsock/test: Introduce vsock_bind_try() helper
Create a socket and bind() it. If binding failed, gracefully return an
error code while preserving `errno`.
Base vsock_bind() on top of it.
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Link: https://patch.msgid.link/20250611-vsock-test-inc-cov-v3-1-5834060d9c20@rbox.co
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/vsock/util.h')
| -rw-r--r-- | tools/testing/vsock/util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h index 5e2db67072d5..0afe7cbae12e 100644 --- a/tools/testing/vsock/util.h +++ b/tools/testing/vsock/util.h @@ -44,6 +44,7 @@ int vsock_connect(unsigned int cid, unsigned int port, int type); int vsock_accept(unsigned int cid, unsigned int port, struct sockaddr_vm *clientaddrp, int type); int vsock_stream_connect(unsigned int cid, unsigned int port); +int vsock_bind_try(unsigned int cid, unsigned int port, int type); int vsock_bind(unsigned int cid, unsigned int port, int type); int vsock_bind_connect(unsigned int cid, unsigned int port, unsigned int bind_port, int type); |
