summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2004-11-29 18:47:27 +0000
committerps <ps@FreeBSD.org>2004-11-29 18:47:27 +0000
commitbe0be8707bee5e412ddea81ae8c0494a9eef9054 (patch)
treeb03e926e0c4b519d7f6db70dff5016673034a385 /sys/netinet
parent5cb50742628dc40e5c863bf0359d9eb6bf149538 (diff)
downloadFreeBSD-src-be0be8707bee5e412ddea81ae8c0494a9eef9054.zip
FreeBSD-src-be0be8707bee5e412ddea81ae8c0494a9eef9054.tar.gz
Fixes a bug in SACK causing us to send data beyond the receive window.
Found by: Pawel Worach and Daniel Hartmeier Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 0e36553..e761acc 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -310,8 +310,10 @@ after_sack_rexmit:
* sending new data, having retransmitted all the
* data possible in the scoreboard.
*/
- len = so->so_snd.sb_cc - off;
- cwin = sendwin - (tp->snd_nxt - tp->sack_newdata) -
+ len = ((long)ulmin(so->so_snd.sb_cc, tp->snd_wnd)
+ - off);
+ cwin = tp->snd_cwnd -
+ (tp->snd_nxt - tp->sack_newdata) -
sack_bytes_rxmt;
if (cwin < 0)
cwin = 0;
OpenPOWER on IntegriCloud