diff options
author | Arseniy Krasnov <avkrasnov@salutedevices.com> | 2023-10-10 22:15:15 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-15 13:19:42 +0100 |
commit | 5fbfc7d243343917793ae95a6011f03b5aac4735 (patch) | |
tree | ba54ddf2e27bad796ecb5821c583398c1a32b763 /net/vmw_vsock | |
parent | 49dbe25adac42d3e06f65d1420946bec65896222 (diff) | |
download | linux-stable-5fbfc7d243343917793ae95a6011f03b5aac4735.tar.gz linux-stable-5fbfc7d243343917793ae95a6011f03b5aac4735.tar.bz2 linux-stable-5fbfc7d243343917793ae95a6011f03b5aac4735.zip |
vsock: check for MSG_ZEROCOPY support on send
This feature totally depends on transport, so if transport doesn't
support it, return error.
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r-- | net/vmw_vsock/af_vsock.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 38486efd3d05..71108b1f0dfc 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1824,6 +1824,12 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg, goto out; } + if (msg->msg_flags & MSG_ZEROCOPY && + !vsock_msgzerocopy_allow(transport)) { + err = -EOPNOTSUPP; + goto out; + } + /* Wait for room in the produce queue to enqueue our user's data. */ timeout = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT); |