diff options
author | davem <davem> | 2002-01-14 07:08:27 +0000 |
---|---|---|
committer | davem <davem> | 2002-01-14 07:08:27 +0000 |
commit | ab6a00b708eaae8ad75f22befe389768170dfff5 (patch) | |
tree | f0c1d59405aa8faf8c9c56faf19a685a38fff3c2 | |
parent | 2db8d017f219b32cb65e7a4437ca9e8cf833ab65 (diff) | |
download | netdev-vger-cvs-ab6a00b708eaae8ad75f22befe389768170dfff5.tar.gz |
When skb_recv_data can return NULL skb with
err == 0 when receive side is shutdown. unix_accept
needs to take care about this and really return
on newsocket resulting in an OOPS.
-rw-r--r-- | net/unix/af_unix.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 1abae4cf7..8c690dcb7 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Version: $Id: af_unix.c,v 1.130 2002-01-12 10:23:13 davem Exp $ + * Version: $Id: af_unix.c,v 1.131 2002-01-14 07:08:27 davem Exp $ * * Fixes: * Linus Torvalds : Assorted bug cures. @@ -1057,8 +1057,12 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags) */ skb = skb_recv_datagram(sk, 0, flags&O_NONBLOCK, &err); - if (!skb) + if (!skb) { + /* This means receive shutdown. */ + if (err == 0) + err = -EINVAL; goto out; + } tsk = skb->sk; skb_free_datagram(sk, skb); |