patch-1.3.68 linux/net/ipv4/tcp.c

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

diff -u --recursive --new-file v1.3.67/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
@@ -480,7 +480,6 @@
 
 	while ((skb = skb_dequeue(&sk->receive_queue)) != NULL) 
 	{
-		skb->sk->dead=1;
 		tcp_close(skb->sk, 0);
 		kfree_skb(skb, FREE_READ);
 	}
@@ -1728,7 +1727,7 @@
 
 /*
  *	Shutdown the sending side of a connection. Much like close except
- *	that we don't receive shut down or set sk->dead=1.
+ *	that we don't receive shut down or set sk->dead.
  */
 
 void tcp_shutdown(struct sock *sk, int how)
@@ -1817,6 +1816,7 @@
 		tcp_set_state(sk, TCP_CLOSE);
 		tcp_close_pending(sk);
 		release_sock(sk);
+		sk->dead = 1;
 		return;
 	}
 	
@@ -1873,9 +1873,9 @@
 	 * This will destroy it. The timers will take care of actually
 	 * free'ing up the memory.
 	 */
-	sk->dead = 1;
 	tcp_cache_zap();	/* Kill the cache again. */
 	release_sock(sk);
+	sk->dead = 1;
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this