aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorJayanth Vijayaraghavan <jayanth@FreeBSD.org>2000-05-16 03:13:59 +0000
committerJayanth Vijayaraghavan <jayanth@FreeBSD.org>2000-05-16 03:13:59 +0000
commit6b2a5f92baeff2e1cf64bc9968f3ca41a95abb59 (patch)
tree80bec6b29ce5b78b434f545a5881e9571e3c1cd3 /sys/netinet
parent4d2d5ed69d08383c63c3cd3b590b0a6dc2ac18a1 (diff)
downloadsrc-6b2a5f92baeff2e1cf64bc9968f3ca41a95abb59.tar.gz
src-6b2a5f92baeff2e1cf64bc9968f3ca41a95abb59.zip
snd_una was being updated incorrectly, this resulted in the newreno
code retransmitting data from the wrong offset. As a footnote, the newreno code was partially derived from NetBSD and Tom Henderson <tomh@cs.berkeley.edu>
Notes
Notes: svn path=/head/; revision=60619
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_input.c11
-rw-r--r--sys/netinet/tcp_reass.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 82ab08fbb957..a93b2cca5d7e 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -2835,18 +2835,23 @@ tcp_newreno(tp, th)
{
if (SEQ_LT(th->th_ack, tp->snd_recover)) {
tcp_seq onxt = tp->snd_nxt;
- tcp_seq ouna = tp->snd_una; /* Haven't updated snd_una yet*/
u_long ocwnd = tp->snd_cwnd;
callout_stop(tp->tt_rexmt);
tp->t_rtttime = 0;
tp->snd_nxt = th->th_ack;
tp->snd_cwnd = tp->t_maxseg;
- tp->snd_una = th->th_ack;
+ /*
+ * Set snd_cwnd to one segment beyond acknowledged offset
+ * (tp->snd_una has not yet been updated when this function
+ * is called)
+ */
+ tp->snd_cwnd = tp->t_maxseg + (th->th_ack - tp->snd_una);
+ (void) tcp_output(tp);
+
(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_reass.c b/sys/netinet/tcp_reass.c
index 82ab08fbb957..a93b2cca5d7e 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -2835,18 +2835,23 @@ tcp_newreno(tp, th)
{
if (SEQ_LT(th->th_ack, tp->snd_recover)) {
tcp_seq onxt = tp->snd_nxt;
- tcp_seq ouna = tp->snd_una; /* Haven't updated snd_una yet*/
u_long ocwnd = tp->snd_cwnd;
callout_stop(tp->tt_rexmt);
tp->t_rtttime = 0;
tp->snd_nxt = th->th_ack;
tp->snd_cwnd = tp->t_maxseg;
- tp->snd_una = th->th_ack;
+ /*
+ * Set snd_cwnd to one segment beyond acknowledged offset
+ * (tp->snd_una has not yet been updated when this function
+ * is called)
+ */
+ tp->snd_cwnd = tp->t_maxseg + (th->th_ack - tp->snd_una);
+ (void) tcp_output(tp);
+
(void) tcp_output(tp);
tp->snd_cwnd = ocwnd;
- tp->snd_una = ouna;
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
/*