summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-07-05 19:23:02 +0000
committerps <ps@FreeBSD.org>2005-07-05 19:23:02 +0000
commit17e64b657e59ca18136a7623d6a7186b2387123d (patch)
tree0f9e6a381b179dcf749dfcbc7b0167e18748d319 /sys
parent09a62d751039d62a78838eea38ca7dd6591622b0 (diff)
downloadFreeBSD-src-17e64b657e59ca18136a7623d6a7186b2387123d.zip
FreeBSD-src-17e64b657e59ca18136a7623d6a7186b2387123d.tar.gz
Fix for a bug in newreno partial ack handling where if a large amount
of data is partial acked, snd_cwnd underflows, causing a burst. Found, Submitted by: Noritoshi Demizu Approved by: re
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c6
-rw-r--r--sys/netinet/tcp_reass.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index f5aa012..c86a3ec 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -3110,7 +3110,11 @@ tcp_newreno_partial_ack(tp, th)
* Partial window deflation. Relies on fact that tp->snd_una
* not updated yet.
*/
- tp->snd_cwnd -= (th->th_ack - tp->snd_una - tp->t_maxseg);
+ if (tp->snd_cwnd > th->th_ack - tp->snd_una)
+ tp->snd_cwnd -= th->th_ack - tp->snd_una;
+ else
+ tp->snd_cwnd = 0;
+ tp->snd_cwnd += tp->t_maxseg;
}
/*
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index f5aa012..c86a3ec 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -3110,7 +3110,11 @@ tcp_newreno_partial_ack(tp, th)
* Partial window deflation. Relies on fact that tp->snd_una
* not updated yet.
*/
- tp->snd_cwnd -= (th->th_ack - tp->snd_una - tp->t_maxseg);
+ if (tp->snd_cwnd > th->th_ack - tp->snd_una)
+ tp->snd_cwnd -= th->th_ack - tp->snd_una;
+ else
+ tp->snd_cwnd = 0;
+ tp->snd_cwnd += tp->t_maxseg;
}
/*
OpenPOWER on IntegriCloud