patch-2.3.99-pre3 linux/net/ipv4/tcp.c

Next file: linux/net/ipv4/tcp_input.c
Previous file: linux/net/ipv4/route.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre2/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp.c,v 1.164 2000/03/08 19:36:40 davem Exp $
+ * Version:	$Id: tcp.c,v 1.165 2000/03/23 05:30:32 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -1337,19 +1337,20 @@
 				break;
 			}
 
-			if (sk->done) {
-				copied = -ENOTCONN;
+			if (sk->shutdown & RCV_SHUTDOWN) {
+				if (!(flags&MSG_PEEK))
+					sk->done = 1;
 				break;
 			}
 
 			if (sk->state == TCP_CLOSE) {
-				if (!(flags&MSG_PEEK))
+				if (sk->done) {
+					copied = -ENOTCONN;
+					break;
+				} else if (!(flags&MSG_PEEK))
 					sk->done = 1;
 				break;
 			}
-
-			if (sk->shutdown & RCV_SHUTDOWN)
-				break;
 
 			if (!timeo) {
 				copied = -EAGAIN;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)