summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2002-09-24 16:28:34 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2002-09-24 16:28:34 +0000
commit8d7717c8f823144d5517d3fb024d5b3b94d688c3 (patch)
tree73189293116829c8a05bf1ae04d19b53a5fbb88e /sys
parent2ddeca5af812996c8755d1c2644b9840711fbd38 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 0b08d2dd18ac..45195111277e 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -979,12 +979,21 @@ after_listen:
tp->snd_nxt = tp->snd_max;
tp->t_badrxtwin = 0;
}
- if ((to.to_flags & TOF_TS) != 0)
+ /*
+ * Recalculate the retransmit timer / rtt.
+ *
+ * Some machines (certain windows boxes)
+ * send broken timestamp replies during the
+ * SYN+ACK phase, ignore timestamps of 0.
+ */
+ if ((to.to_flags & TOF_TS) != 0 &&
+ to.to_tsecr) {
tcp_xmit_timer(tp,
ticks - to.to_tsecr + 1);
- else if (tp->t_rtttime &&
- SEQ_GT(th->th_ack, tp->t_rtseq))
+ } else if (tp->t_rtttime &&
+ SEQ_GT(th->th_ack, tp->t_rtseq)) {
tcp_xmit_timer(tp, ticks - tp->t_rtttime);
+ }
tcp_xmit_bandwidth_limit(tp, th->th_ack);
acked = th->th_ack - tp->snd_una;
tcpstat.tcps_rcvackpack++;
@@ -1773,11 +1782,17 @@ process_ACK:
* Since we now have an rtt measurement, cancel the
* timer backoff (cf., Phil Karn's retransmit alg.).
* Recompute the initial retransmit timer.
+ *
+ * Some machines (certain windows boxes) send broken
+ * timestamp replies during the SYN+ACK phase, ignore
+ * timestamps of 0.
*/
- if (to.to_flags & TOF_TS)
+ if ((to.to_flags & TOF_TS) != 0 &&
+ to.to_tsecr) {
tcp_xmit_timer(tp, ticks - to.to_tsecr + 1);
- else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq))
+ } else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq)) {
tcp_xmit_timer(tp, ticks - tp->t_rtttime);
+ }
tcp_xmit_bandwidth_limit(tp, th->th_ack);
/*