Skip to content

Commit

Permalink
vsock: return errors other than -ENOMEM to socket
Browse files Browse the repository at this point in the history
This removes behaviour, where error code returned from any transport
was always switched to ENOMEM. For example when user tries to send too
big message via SEQPACKET socket, transport layers return EMSGSIZE, but
this error code was always replaced with ENOMEM and returned to user.

Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com>
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Bobby Eshleman authored and Paolo Abeni committed Jan 12, 2023
1 parent d4f12a8 commit c43170b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/vmw_vsock/af_vsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,8 +1861,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
written = transport->stream_enqueue(vsk,
msg, len - total_written);
}

if (written < 0) {
err = -ENOMEM;
err = written;
goto out_err;
}

Expand Down

0 comments on commit c43170b

Please sign in to comment.