patch-2.1.53 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.52/linux/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
@@ -447,6 +447,7 @@
 			
 			/* TCP_LISTEN is implied. */
 			if (!sk->sock_readers && tp->syn_wait_queue) {
+				struct open_request *prev = (struct open_request *)(&tp->syn_wait_queue);
 				struct open_request *req = tp->syn_wait_queue;
 				do {
 					struct open_request *conn;
@@ -454,13 +455,15 @@
 					conn = req;
 					req = req->dl_next;
 
-					if (conn->sk)
-						continue;
+					if (conn->sk) {
+						prev = conn; 
+						continue; 
+					}
 
 					if ((long)(now - conn->expires) <= 0)
 						break;
 
-					tcp_synq_unlink(tp, conn);
+					tcp_synq_unlink(tp, conn, prev);
 					if (conn->retrans >= sysctl_tcp_retries1) {
 #ifdef TCP_DEBUG
 						printk(KERN_DEBUG "syn_recv: "
@@ -475,6 +478,7 @@
 							break;
 					} else {
 						__u32 timeo;
+						struct open_request *op; 
 
 						(*conn->class->rtx_syn_ack)(sk, conn);
 
@@ -487,8 +491,12 @@
 							     << conn->retrans),
 							    120*HZ);
 						conn->expires = now + timeo;
+						op = prev->dl_next; 
 						tcp_synq_queue(tp, conn);
+						if (op != prev->dl_next)
+							prev = prev->dl_next;
 					}
+					/* old prev still valid here */
 				} while (req);
 			}
 			sk = sk->next;

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