diff options
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-rw-r--r-- | net/dccp/ccids/ccid2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 2b75df469220..842a9c7c73a3 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -229,14 +229,16 @@ static void ccid2_cwnd_restart(struct sock *sk, const u32 now) | |||
229 | struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); | 229 | struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); |
230 | u32 cwnd = hc->tx_cwnd, restart_cwnd, | 230 | u32 cwnd = hc->tx_cwnd, restart_cwnd, |
231 | iwnd = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache); | 231 | iwnd = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache); |
232 | s32 delta = now - hc->tx_lsndtime; | ||
232 | 233 | ||
233 | hc->tx_ssthresh = max(hc->tx_ssthresh, (cwnd >> 1) + (cwnd >> 2)); | 234 | hc->tx_ssthresh = max(hc->tx_ssthresh, (cwnd >> 1) + (cwnd >> 2)); |
234 | 235 | ||
235 | /* don't reduce cwnd below the initial window (IW) */ | 236 | /* don't reduce cwnd below the initial window (IW) */ |
236 | restart_cwnd = min(cwnd, iwnd); | 237 | restart_cwnd = min(cwnd, iwnd); |
237 | cwnd >>= (now - hc->tx_lsndtime) / hc->tx_rto; | ||
238 | hc->tx_cwnd = max(cwnd, restart_cwnd); | ||
239 | 238 | ||
239 | while ((delta -= hc->tx_rto) >= 0 && cwnd > restart_cwnd) | ||
240 | cwnd >>= 1; | ||
241 | hc->tx_cwnd = max(cwnd, restart_cwnd); | ||
240 | hc->tx_cwnd_stamp = now; | 242 | hc->tx_cwnd_stamp = now; |
241 | hc->tx_cwnd_used = 0; | 243 | hc->tx_cwnd_used = 0; |
242 | 244 | ||