summaryrefslogtreecommitdiff
path: root/net/dccp/ccids/ccid2.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-06 14:14:25 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-06 14:14:24 -0700
commitc44da670c28766ea7fa8b46453e9111965bf2eb2 (patch)
tree79d7b94b76dc3eb27d74ef7be44e2f88e1dc39f8 /net/dccp/ccids/ccid2.c
parent356bd90ee7d4caac787e2c4c9da68b585b7cf48b (diff)
parentb87d31674ac9e8203f3a30b53f6a697bf5cf36b6 (diff)
Merge "Merge android-4.4.153 (5e24b4e) into msm-4.4"
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-rw-r--r--net/dccp/ccids/ccid2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 86a2ed0fb219..161dfcf86126 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -228,14 +228,16 @@ static void ccid2_cwnd_restart(struct sock *sk, const u32 now)
struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
u32 cwnd = hc->tx_cwnd, restart_cwnd,
iwnd = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache);
+ s32 delta = now - hc->tx_lsndtime;
hc->tx_ssthresh = max(hc->tx_ssthresh, (cwnd >> 1) + (cwnd >> 2));
/* don't reduce cwnd below the initial window (IW) */
restart_cwnd = min(cwnd, iwnd);
- cwnd >>= (now - hc->tx_lsndtime) / hc->tx_rto;
- hc->tx_cwnd = max(cwnd, restart_cwnd);
+ while ((delta -= hc->tx_rto) >= 0 && cwnd > restart_cwnd)
+ cwnd >>= 1;
+ hc->tx_cwnd = max(cwnd, restart_cwnd);
hc->tx_cwnd_stamp = now;
hc->tx_cwnd_used = 0;