diff options
| author | Paul Saab <ps@FreeBSD.org> | 2005-01-12 21:40:51 +0000 |
|---|---|---|
| committer | Paul Saab <ps@FreeBSD.org> | 2005-01-12 21:40:51 +0000 |
| commit | 8d03f2b53b7df58bc0f80a2983e36896ae728ec5 (patch) | |
| tree | a5f83215e8951bccb6915170fbae2eae41034fb8 /sys/netinet/tcp_output.c | |
| parent | 3952015f409925eeb777f0bbf4ef87d41a94396f (diff) | |
Notes
Diffstat (limited to 'sys/netinet/tcp_output.c')
| -rw-r--r-- | sys/netinet/tcp_output.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 2a88c521a39a..fce9c9c448a1 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -312,12 +312,22 @@ after_sack_rexmit: */ 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; - len = lmin(len, cwin); + /* + * Don't remove this (len > 0) check ! + * We explicitly check for len > 0 here (although it + * isn't really necessary), to work around a gcc + * optimization issue - to force gcc to compute + * len above. Without this check, the computation + * of len is bungled by the optimizer. + */ + if (len > 0) { + cwin = tp->snd_cwnd - + (tp->snd_nxt - tp->sack_newdata) - + sack_bytes_rxmt; + if (cwin < 0) + cwin = 0; + len = lmin(len, cwin); + } } } |
