03.01.2021 23:04, Arseny Krasnov пишет:
From: Arseniy Krasnov <oxfff...@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?

Reply via email to