Module Name:    src
Committed By:   gdt
Date:           Wed May 25 23:20:57 UTC 2011

Modified Files:
        src/sys/netinet: tcp_input.c

Log Message:
Remove erroneous additional tick in RTO estimation.  The variable
ts_rtt is 1 plus the RTT, so that 0 can mean invalid measurement.
However, the code failed to subtract the 1 back out before use.  With
this change, TCP from Massachusetts to France now typically has 1s RTO
values, rather than 1.5s.

This bug was found and fixed by Bev Schwartz of BBN.  This material is
based upon work supported by the Defense Advanced Research Projects
Agency and Space and Naval Warfare Systems Center, Pacific, under
Contract No. N66001-09-C-2073.  Approved for Public Release,
Distribution Unlimited


To generate a diff of this commit:
cvs rdiff -u -r1.313 -r1.314 src/sys/netinet/tcp_input.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.313 src/sys/netinet/tcp_input.c:1.314
--- src/sys/netinet/tcp_input.c:1.313	Tue May 17 05:40:24 2011
+++ src/sys/netinet/tcp_input.c	Wed May 25 23:20:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.313 2011/05/17 05:40:24 dholland Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.314 2011/05/25 23:20:57 gdt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.313 2011/05/17 05:40:24 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.314 2011/05/25 23:20:57 gdt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -2001,7 +2001,7 @@
 				 * this is a pure ack for outstanding data.
 				 */
 				if (ts_rtt)
-					tcp_xmit_timer(tp, ts_rtt);
+					tcp_xmit_timer(tp, ts_rtt - 1);
 				else if (tp->t_rtttime &&
 				    SEQ_GT(th->th_ack, tp->t_rtseq))
 					tcp_xmit_timer(tp,
@@ -2689,7 +2689,7 @@
 		 * Recompute the initial retransmit timer.
 		 */
 		if (ts_rtt)
-			tcp_xmit_timer(tp, ts_rtt);
+			tcp_xmit_timer(tp, ts_rtt - 1);
 		else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq))
 			tcp_xmit_timer(tp, tcp_now - tp->t_rtttime);
 

Reply via email to