mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Rao Shoaib <Rao.Shoaib@oracle.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	matthew.wilcox@oracle.com
Subject: Re: [RFC net-next af_unix v1 1/1] net:af_unix: Allow unix sockets to raise SIGURG
Date: Tue, 18 May 2021 17:55:55 +0100	[thread overview]
Message-ID: <YKPxm8+8Wz5mTPba@casper.infradead.org> (raw)
In-Reply-To: <20210518074343.980438-1-Rao.Shoaib@oracle.com>

On Tue, May 18, 2021 at 12:43:43AM -0700, Rao Shoaib wrote:
> From: Rao Shoaib <rao.shoaib@oracle.com>
> 
> TCP sockets allow SIGURG to be sent to the process holding the other
> end of the socket.  Extend Unix sockets to have the same ability.
> 
> The API is the same in that the sender uses sendmsg() with MSG_OOB to
> raise SIGURG.  Unix sockets behave in the same way as TCP sockets with
> SO_OOBINLINE set.
> 
> SIGURG is ignored by default, so applications which do not know about this
> feature will be unaffected.  In addition to installing a SIGURG handler,
> the receiving application must call F_SETOWN or F_SETOWN_EX to indicate
> which process or thread should receive the signal.
> 
> Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
> Signed-off-by: Matthew Wilcox <matthew.wilcox@oracle.com>

Please don't forge my Signed-off-by.  With that line deleted,

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

> ---
>  net/unix/af_unix.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 5a31307ceb76..c8400c002882 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1838,8 +1838,6 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
>  		return err;
>  
>  	err = -EOPNOTSUPP;
> -	if (msg->msg_flags&MSG_OOB)
> -		goto out_err;
>  
>  	if (msg->msg_namelen) {
>  		err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP;
> @@ -1904,6 +1902,9 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
>  		sent += size;
>  	}
>  
> +	if (msg->msg_flags & MSG_OOB)
> +		sk_send_sigurg(other);
> +
>  	scm_destroy(&scm);
>  
>  	return sent;
> -- 
> 2.31.1
> 

      reply	other threads:[~2021-05-18 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  7:43 Rao Shoaib
2021-05-18 16:55 ` Matthew Wilcox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKPxm8+8Wz5mTPba@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Rao.Shoaib@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.wilcox@oracle.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®