patch-2.1.30 linux/net/ipv4/tcp_timer.c

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

diff -u --recursive --new-file v2.1.29/linux/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
@@ -255,7 +255,7 @@
 		return;
 	}
 	
-	if (sk->users) 
+	if (sk->sock_readers) 
 	{
 		/* 
 		 * Try again in second 
@@ -401,6 +401,8 @@
 		return;
 	}
 
+	lock_sock(sk);
+
 	/*
 	 * Clear delay ack timer
 	 */
@@ -412,16 +414,15 @@
 	 */
 
 	tp->retrans_head = NULL;
-	
 
 	if (sk->retransmits == 0)
 	{
-		/* 
-		 * remember window where we lost 
+		/*
+		 * remember window where we lost
 		 * "one half of the current window but at least 2 segments"
 		 */
-		
-		sk->ssthresh = max(sk->cong_window >> 1, 2); 
+
+		sk->ssthresh = max(sk->cong_window >> 1, 2);
 		sk->cong_count = 0;
 		sk->cong_window = 1;
 	}
@@ -452,6 +453,8 @@
 	tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto);
 
 	tcp_write_timeout(sk);
+
+	release_sock(sk);
 }
 
 /*
@@ -472,7 +475,7 @@
 			struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
 			
 			/* TCP_LISTEN is implied. */
-			if (!sk->users && tp->syn_wait_queue) {
+			if (!sk->sock_readers && tp->syn_wait_queue) {
 				struct open_request *req;
 
 				req = tp->syn_wait_queue;

FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected]