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

Next file: linux/net/ipv6/addrconf.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.8/linux/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
@@ -472,20 +472,26 @@
 			    tp->syn_wait_queue)
 			{
 				struct open_request *req;
-				
+
 				req = tp->syn_wait_queue;
 
-				while (tp->syn_wait_queue &&
-				       (((long)(req->expires - now)) <= 0))
+				while (req && tp->syn_wait_queue)
 				{
 					struct open_request *conn;
 
 					conn = req;
 					req = req->dl_next;
 
-					if (conn->sk && conn->sk->state > TCP_SYN_RECV)
+					if (conn->sk)
+					{
+						if (req == tp->syn_wait_queue)
+							break;
 						continue;
+					}
 					
+					if ((long)(now - conn->expires) <= 0)
+						break;
+
 					tcp_synq_unlink(tp, conn);
 					
 					if (conn->retrans >= TCP_RETR1)
@@ -548,4 +554,26 @@
 		tcp_slow_timer.expires = now + next;
 		add_timer(&tcp_slow_timer);
 	}
+}
+
+void __tcp_inc_slow_timer(struct tcp_sl_timer *slt)
+{
+	unsigned long now = jiffies;
+	unsigned long next = 0;
+	unsigned long when;
+
+	slt->last = now;
+		
+	when = now + slt->period;
+	if (del_timer(&tcp_slow_timer))
+	{
+		next = tcp_slow_timer.expires;
+	}
+	if (next && ((long)(next - when) < 0))
+	{
+		when = next;
+	}
+		
+	tcp_slow_timer.expires = when;
+	add_timer(&tcp_slow_timer);
 }

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