summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1999-01-27 16:47:30 +0000
committerNiels Provos <provos@cvs.openbsd.org>1999-01-27 16:47:30 +0000
commit655577afa6e60abc68bf0728f28d71e3cb307b0a (patch)
treeebdf97649ef9611ba2407a6a5eda416575d39b9a /sys/netinet
parentb52a7c673cb776665972b0e9265e491abc43a4b1 (diff)
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.
Diffstat (limited to 'sys/netinet')
-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.
*/