patch-2.3.49 linux/net/ipv4/tcp_input.c

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

diff -u --recursive --new-file v2.3.48/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_input.c,v 1.188 2000/02/08 21:27:14 davem Exp $
+ * Version:	$Id: tcp_input.c,v 1.189 2000/02/27 19:52:55 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -534,6 +534,9 @@
 			sk->err = ECONNRESET;
 	}
 
+	if (!sk->dead)
+		sk->error_report(sk);
+
 	tcp_done(sk);
 }
 
@@ -1660,7 +1663,12 @@
 
 	if (!sk->dead) {
 		sk->state_change(sk);
-		sock_wake_async(sk->socket, 1, POLL_HUP);
+
+		/* Do not send POLL_HUP for half duplex close. */
+		if (sk->shutdown == SHUTDOWN_MASK || sk->state == TCP_CLOSE)
+			sock_wake_async(sk->socket, 1, POLL_HUP);
+		else
+			sock_wake_async(sk->socket, 1, POLL_IN);
 	}
 }
 

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