patch-1.3.69 linux/net/ipv4/tcp_input.c

Next file: linux/net/ipx/af_ipx.c
Previous file: linux/net/ipv4/packet.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.68/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
@@ -18,6 +18,9 @@
  *		Matthew Dillon, <dillon@apollo.west.oic.com>
  *		Arnt Gulbrandsen, <agulbra@nvg.unit.no>
  *		Jorge Cwik, <jorge@laser.satlink.net>
+ *
+ * FIXES
+ *		Pedro Roque	:	Double ACK bug
  */
 
 #include <linux/config.h>
@@ -1420,19 +1423,21 @@
 			 *      - must send at least every 2 full sized packets
 			 */
 			if (!sk->delay_acks ||
-			    sk->ack_backlog >= sk->max_ack_backlog || 
+			    /* sk->ack_backlog >= sk->max_ack_backlog || */
 			    sk->bytes_rcv > sk->max_unacked || th->fin ||
 			    sk->ato > HZ/2 ||
 			    tcp_raise_window(sk)) {
-	/*			tcp_send_ack(sk->sent_seq, sk->acked_seq,sk,th, saddr); */
+				tcp_send_ack(sk->sent_seq, sk->acked_seq,sk,th, saddr);
 			}
 			else 
-			{
+			{	
 				sk->ack_backlog++;
-				
+			
 				if(sk->debug)				
 					printk("Ack queued.\n");
+				
 				tcp_reset_xmit_timer(sk, TIME_WRITE, sk->ato);
+				
 			}
 		}
 	}
@@ -1475,11 +1480,7 @@
 		}
 		tcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr);
 		sk->ack_backlog++;
-		tcp_reset_xmit_timer(sk, TIME_WRITE, min(sk->ato, 0.5 * HZ));
-	}
-	else
-	{
-		tcp_send_ack(sk->sent_seq, sk->acked_seq, sk, th, saddr);
+		tcp_reset_xmit_timer(sk, TIME_WRITE, min(sk->ato, HZ/2));
 	}
 
 	/*

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