[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1445434184.22974.50.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 21 Oct 2015 06:29:44 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Alan Burlison <Alan.Burlison@...cle.com>
Cc: David Laight <David.Laight@...LAB.COM>,
Stephen Hemminger <stephen@...workplumber.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: Fw: [Bug 106241] New: shutdown(3)/close(3) behaviour is
incorrect for sockets in accept(3)
On Wed, 2015-10-21 at 14:03 +0100, Alan Burlison wrote:
> On 21/10/2015 12:28, Eric Dumazet wrote:
>
> > This works for me. Please double check your programs
>
> I have just done so, it works as you say for AF_INET sockets but if you
> switch to AF_UNIX sockets it does the wrong thing in the way I described.
>
Oh well. Please try the following :
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 94f658235fb4..24dec8bb571d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -328,7 +328,8 @@ found:
static inline int unix_writable(struct sock *sk)
{
- return (atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
+ return sk->sk_state != TCP_LISTEN &&
+ (atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
}
static void unix_write_space(struct sock *sk)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists