From 6c7da5940bde6cc28d2da46ed69ec4446306d5e5 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Wed, 23 May 2018 13:35:33 +0200 Subject: [PATCH] Fixes off by one error in BBR random cycle initialization. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8415 Change-Id: I2055b10c8a99a9bde4152a7b3f66c695ab329f68 Reviewed-on: https://webrtc-review.googlesource.com/78441 Reviewed-by: Björn Terelius Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#23367} --- modules/congestion_controller/bbr/bbr_network_controller.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/congestion_controller/bbr/bbr_network_controller.cc b/modules/congestion_controller/bbr/bbr_network_controller.cc index 63c8e4cd53..7ca1d1450e 100644 --- a/modules/congestion_controller/bbr/bbr_network_controller.cc +++ b/modules/congestion_controller/bbr/bbr_network_controller.cc @@ -472,7 +472,7 @@ void BbrNetworkController::EnterProbeBandwidthMode(Timestamp now) { // Pick a random offset for the gain cycle out of {0, 2..7} range. 1 is // excluded because in that case increased gain and decreased gain would not // follow each other. - cycle_current_offset_ = random_.Rand(kGainCycleLength - 1); + cycle_current_offset_ = random_.Rand(kGainCycleLength - 2); if (cycle_current_offset_ >= 1) { cycle_current_offset_ += 1; }