patch-2.2.0-pre2 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.2.0-pre1/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.132 1998/11/08 13:21:14 davem Exp $
+ * Version:	$Id: tcp.c,v 1.133 1998/11/30 15:13:06 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -1612,19 +1612,15 @@
 	if(sk->keepopen)
 		tcp_inc_slow_timer(TCP_SLT_KEEPALIVE);
 
-	/*
-	 * This does not pass any already set errors on the new socket
-	 * to the user, but they will be returned on the first socket operation
-	 * after the accept.
-	 *
-	 * Once linux gets a multithreaded net_bh or equivalent there will be a race
-	 * here - you'll have to check for sk->zapped as set by the ICMP handler then.
-	 */
+	release_sock(sk);
+	return newsk;
 
-	error = 0;
 out:
+	/* sk should be in LISTEN state, thus accept can use sk->err for
+	 * internal purposes without stomping one anyone's feed.
+	 */ 
+	sk->err = error; 
 	release_sock(sk);
-	sk->err = error;
 	return newsk;
 }
 

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