diff options
author | Arseniy Krasnov <avkrasnov@salutedevices.com> | 2023-09-11 23:20:26 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-09-14 08:19:55 +0200 |
commit | 8ecf0cedc08a3a8e663918d22f0350a928ac115c (patch) | |
tree | 13b40599a6fc18b44bc1704d58369bfaff9140da /net/vmw_vsock | |
parent | ca5ab9638e925613f73b575041801a7b2fd26bd4 (diff) |
vsock: send SIGPIPE on write to shutdowned socket
POSIX requires to send SIGPIPE on write to SOCK_STREAM socket which was
shutdowned with SHUT_WR flag or its peer was shutdowned with SHUT_RD
flag. Also we must not send SIGPIPE if MSG_NOSIGNAL flag is set.
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r-- | net/vmw_vsock/af_vsock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 020cf17ab7e4..013b65241b65 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1921,6 +1921,9 @@ out_err: err = total_written; } out: + if (sk->sk_type == SOCK_STREAM) + err = sk_stream_error(sk, msg->msg_flags, err); + release_sock(sk); return err; } |