summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprovos <provos@openbsd.org>1999-01-27 16:47:29 +0000
committerprovos <provos@openbsd.org>1999-01-27 16:47:29 +0000
commite2b5f08291e40862be40632fd81b16261d09cf5e (patch)
tree5c3a3d5a9513503ab8b4827fcb61d5fa8e7bc358
parentreordered FIN segments caused early termination, bug introduced by ipv6 integration (diff)
downloadwireguard-openbsd-e2b5f08291e40862be40632fd81b16261d09cf5e.tar.xz
wireguard-openbsd-e2b5f08291e40862be40632fd81b16261d09cf5e.zip
fix NEWRENO behaviour, the newreo code assumed that the send socket buffer has
already been cleared of the acked data, though it was called before any sbdrop() call and always called tcp_output() with 0 index in the send socket buffer and thus causing data corruption. so do not set snd_una to th_ack.
-rw-r--r--sys/netinet/tcp_input.c11
-rw-r--r--sys/netinet/tcp_timer.c5
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 354c98311b5..76f28e51d1a 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.27 1999/01/27 10:04:57 niklas Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.28 1999/01/27 16:47:29 provos Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -2912,17 +2912,20 @@ tcp_newreno(tp, th)
struct tcphdr *th;
{
if (SEQ_LT(th->th_ack, tp->snd_last)) {
+ /*
+ * snd_una has not been updated and the socket send buffer
+ * not yet drained of the acked data, so we have to leave
+ * snd_una as it was to get the correct data offset in
+ * tcp_output().
+ */
tcp_seq onxt = tp->snd_nxt;
- tcp_seq ouna = tp->snd_una; /* snd_una not yet updated */
u_long ocwnd = tp->snd_cwnd;
tp->t_timer[TCPT_REXMT] = 0;
tp->t_rtt = 0;
tp->snd_nxt = th->th_ack;
tp->snd_cwnd = tp->t_maxseg;
- tp->snd_una = th->th_ack;
(void) tcp_output(tp);
tp->snd_cwnd = ocwnd;
- tp->snd_una = ouna;
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
/*
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index bd2d69c8fa6..217cb6464f0 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_timer.c,v 1.10 1998/11/25 05:44:37 millert Exp $ */
+/* $OpenBSD: tcp_timer.c,v 1.11 1999/01/27 16:47:29 provos Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
@@ -247,9 +247,6 @@ tcp_timers(tp, timer)
tp->t_srtt = 0;
}
tp->snd_nxt = tp->snd_una;
-#if defined (TCP_NEWRENO) || defined (TCP_SACK)
- tp->snd_last = tp->snd_una;
-#endif
/*
* If timing a segment in this window, stop the timer.
*/