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

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

diff -u --recursive --new-file v2.1.9/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
@@ -194,11 +194,18 @@
 	/*
 	 *	We want the right error as BSD sees it (and indeed as we do).
 	 */
-	sk->err = ECONNRESET;
-	if (sk->state == TCP_SYN_SENT)
-		sk->err = ECONNREFUSED;
-	if (sk->state == TCP_CLOSE_WAIT)
-		sk->err = EPIPE;
+	switch (sk->state) {
+		case TCP_TIME_WAIT:
+			break;
+		case TCP_SYN_SENT:
+			sk->err = ECONNREFUSED;
+			break;
+		case TCP_CLOSE_WAIT:
+			sk->err = EPIPE;
+			break;
+		default:
+			sk->err = ECONNRESET;
+	}
 #ifdef CONFIG_TCP_RFC1337
 	/*
 	 *	Time wait assassination protection [RFC1337]

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov