summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2005-03-12 08:07:09 +0000
committermarkus <markus@openbsd.org>2005-03-12 08:07:09 +0000
commit7d40e369389ce5ddf929949faa9f918410bb40d8 (patch)
tree7835ba4672425e76726e1a26ff2ef6cf2da674a6 /sys/netinet/tcp_input.c
parentshutdown the inetd socket for reading if secure; ok deraadt (diff)
downloadwireguard-openbsd-7d40e369389ce5ddf929949faa9f918410bb40d8.tar.xz
wireguard-openbsd-7d40e369389ce5ddf929949faa9f918410bb40d8.zip
make sure code and comment match
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 24bf0082ca2..a55e411ed12 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.184 2005/03/09 11:14:37 markus Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.185 2005/03/12 08:07:09 markus Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -1377,13 +1377,17 @@ trimthenstep6:
/*
* If last ACK falls within this segment's sequence numbers,
- * record its timestamp.
- * Fix from Braden, see Stevens p. 870
+ * record its timestamp if it's more recent.
+ * Cf fix from Braden, see Stevens p. 870
*/
if (opti.ts_present && TSTMP_GEQ(opti.ts_val, tp->ts_recent) &&
SEQ_LEQ(th->th_seq, tp->last_ack_sent)) {
+ if (SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen +
+ ((tiflags & (TH_SYN|TH_FIN)) != 0)))
+ tp->ts_recent = opti.ts_val;
+ else
+ tp->ts_recent = 0;
tp->ts_recent_age = tcp_now;
- tp->ts_recent = opti.ts_val;
}
/*