-- eric
---------------------------------------------------------------------------
Eric Schenk www: http://www.cs.toronto.edu/~schenk
Department of Computer Science email: schenk@cs.toronto.edu
University of Toronto
diff -u -r linux-1.3.90/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
--- linux-1.3.90/net/ipv4/tcp_input.c Tue Apr 16 23:10:30 1996
+++ linux/net/ipv4/tcp_input.c Wed Apr 17 02:19:42 1996
@@ -92,14 +92,20 @@
*/
m = jiffies - oskb->when; /* RTT */
- if(m<=0)
- m=1; /* IS THIS RIGHT FOR <0 ??? */
- m -= (sk->rtt >> 3); /* m is now error in rtt est */
- sk->rtt += m; /* rtt = 7/8 rtt + 1/8 new */
- if (m < 0)
- m = -m; /* m is now abs(error) */
- m -= (sk->mdev >> 2); /* similar update on mdev */
- sk->mdev += m; /* mdev = 3/4 mdev + 1/4 new */
+ if (sk->rtt != 0) {
+ if(m<=0)
+ m=1; /* IS THIS RIGHT FOR <0 ??? */
+ m -= (sk->rtt >> 3); /* m is now error in rtt est */
+ sk->rtt += m; /* rtt = 7/8 rtt + 1/8 new */
+ if (m < 0)
+ m = -m; /* m is now abs(error) */
+ m -= (sk->mdev >> 2); /* similar update on mdev */
+ sk->mdev += m; /* mdev = 3/4 mdev + 1/4 new */
+ } else {
+ /* no previous measure. */
+ sk->rtt = m<<3; /* take the measured time to be rtt */
+ sk->mdev = m<<2; /* make sure rto = 3*rtt */
+ }
/*
* Now update timeout. Note that this removes any backoff.