diff options
| author | Luigi Leonardi <[email protected]> | 2024-07-30 19:43:08 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2024-08-02 08:20:28 +0000 |
| commit | 18ee44ce97c18ee72f5807140d07ff8cebe3cab5 (patch) | |
| tree | bed6f1d43b4e565cda910594fac8835701c715f0 /tools/testing/vsock/util.c | |
| parent | vsock/virtio: add SIOCOUTQ support for all virtio based transports (diff) | |
| download | kernel-18ee44ce97c18ee72f5807140d07ff8cebe3cab5.tar.gz kernel-18ee44ce97c18ee72f5807140d07ff8cebe3cab5.zip | |
test/vsock: add ioctl unsent bytes test
Introduce two tests, one for SOCK_STREAM and one for SOCK_SEQPACKET,
which use SIOCOUTQ ioctl to check that the number of unsent bytes is
zero after delivering a packet.
vsock_connect and vsock_accept are no longer static: this is to
create more generic tests, allowing code to be reused for SEQPACKET
and STREAM.
Signed-off-by: Luigi Leonardi <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/testing/vsock/util.c')
| -rw-r--r-- | tools/testing/vsock/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/vsock/util.c b/tools/testing/vsock/util.c index 554b290fefdc..a3d448a075e3 100644 --- a/tools/testing/vsock/util.c +++ b/tools/testing/vsock/util.c @@ -139,7 +139,7 @@ int vsock_bind_connect(unsigned int cid, unsigned int port, unsigned int bind_po } /* Connect to <cid, port> and return the file descriptor. */ -static int vsock_connect(unsigned int cid, unsigned int port, int type) +int vsock_connect(unsigned int cid, unsigned int port, int type) { union { struct sockaddr sa; @@ -226,8 +226,8 @@ static int vsock_listen(unsigned int cid, unsigned int port, int type) /* Listen on <cid, port> and return the first incoming connection. The remote * address is stored to clientaddrp. clientaddrp may be NULL. */ -static int vsock_accept(unsigned int cid, unsigned int port, - struct sockaddr_vm *clientaddrp, int type) +int vsock_accept(unsigned int cid, unsigned int port, + struct sockaddr_vm *clientaddrp, int type) { union { struct sockaddr sa; |
