Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Remove erroneous additional tick in RTO estimati...



details:   https://anonhg.NetBSD.org/src/rev/a32088123b78
branches:  trunk
changeset: 765417:a32088123b78
user:      gdt <gdt%NetBSD.org@localhost>
date:      Wed May 25 23:20:57 2011 +0000

description:
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

diffstat:

 sys/netinet/tcp_input.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 1bcd0ac70d8e -r a32088123b78 sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Wed May 25 23:17:44 2011 +0000
+++ b/sys/netinet/tcp_input.c   Wed May 25 23:20:57 2011 +0000
@@ -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);
 



Home | Main Index | Thread Index | Old Index