lkml.org 
[lkml]   [2021]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/5] af_vsock: add socket ops for SOCK_SEQPACKET.
From
Date
03.01.2021 23:04, Arseny Krasnov пишет:
> From: Arseniy Krasnov <oxffffaa@gmail.com>
>
> ---
> net/vmw_vsock/af_vsock.c | 107 +++++++++++++++++++++++++++++++++------
> 1 file changed, 91 insertions(+), 16 deletions(-)
>
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 7ff00449a9a2..30caad9815f7 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -452,6 +452,7 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
> new_transport = transport_dgram;
> break;
> case SOCK_STREAM:
> + case SOCK_SEQPACKET:
> if (vsock_use_local_transport(remote_cid))
> new_transport = transport_local;
> else if (remote_cid <= VMADDR_CID_HOST || !transport_h2g ||
> @@ -459,6 +460,12 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
> new_transport = transport_g2h;
> else
> new_transport = transport_h2g;
> +
> + if (sk->sk_type == SOCK_SEQPACKET) {
> + if (!new_transport->seqpacket_seq_send_len ||
> + !new_transport->seqpacket_seq_get_len)
> + return -ENODEV;

Is ENODEV the right error here?
Just a quick look at a man page, and
I am under impression something like
EPROTONOSUPPORT or ESOCKNOSUPPORT
may suit?

\
 
 \ /
  Last update: 2021-01-03 22:27    [W:0.106 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site