bug 1509 RTTEstimator invalid values fix
authorBrian Swenson <bswenson3@gatech.edu>
Mon, 05 Nov 2012 14:07:02 -0500
changeset 9118 5991df10eb5e
parent 9117 6ed1556809ea
child 9119 9c0cc3997ece
bug 1509 RTTEstimator invalid values fix
RELEASE_NOTES
src/internet/model/tcp-socket-base.cc
--- a/RELEASE_NOTES	Fri Nov 02 15:39:41 2012 -0700
+++ b/RELEASE_NOTES	Mon Nov 05 14:07:02 2012 -0500
@@ -35,6 +35,7 @@
  - bug 1493 - test.py --list should show the test type default tip
  - bug 1494 - test.py --constrain doesn't work
  - bug 1495 - test.py claims test passed when no test was run
+ - bug 1509 - rttEstimator returns invalid value in presence of errors
 
 Known issues
 ------------
--- a/src/internet/model/tcp-socket-base.cc	Fri Nov 02 15:39:41 2012 -0700
+++ b/src/internet/model/tcp-socket-base.cc	Mon Nov 05 14:07:02 2012 -0500
@@ -1982,7 +1982,16 @@
   // Use m_rtt for the estimation. Note, RTT of duplicated acknowledgement
   // (which should be ignored) is handled by m_rtt. Once timestamp option
   // is implemented, this function would be more elaborated.
-  m_lastRtt = m_rtt->AckSeq (tcpHeader.GetAckNumber () );
+  Time nextRtt =  m_rtt->AckSeq (tcpHeader.GetAckNumber () );
+
+  //nextRtt will be zero for dup acks.  Don't want to update lastRtt in that case
+  //but still needed to do list clearing that is done in AckSeq. 
+  if(nextRtt != 0)
+  {
+    m_lastRtt = nextRtt;
+    NS_LOG_FUNCTION(this << m_lastRtt);
+  }
+  
 }
 
 // Called by the ReceivedAck() when new ACK received and by ProcessSynRcvd()