aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-02-05 16:34:32 +0000
committerGerrit Code Review <gerrit@fd.io>2020-02-05 16:34:32 +0000
commit2f6e378577c7976aeb4d0b054a15aa3964a2c9de (patch)
treed0be83e17b1a9b223e14246858b55d79a97d616e /libtransport/src/hicn
parent36b58c1359947e6c9d372560641e34cce5ff9caf (diff)
parentacc777f02b93244d4d85446e890e94dbff2d6ada (diff)
Merge "[HICN-503] correctly compute drop probability in RAAQM"
Diffstat (limited to 'libtransport/src/hicn')
-rw-r--r--libtransport/src/hicn/transport/protocols/raaqm.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libtransport/src/hicn/transport/protocols/raaqm.cc b/libtransport/src/hicn/transport/protocols/raaqm.cc
index 21a59bc..a57eb7c 100644
--- a/libtransport/src/hicn/transport/protocols/raaqm.cc
+++ b/libtransport/src/hicn/transport/protocols/raaqm.cc
@@ -567,7 +567,8 @@ void RaaqmTransportProtocol::RAAQM() {
// Change drop probability according to RTT statistics
cur_path_->updateDropProb();
- if (std::rand() % 10000 <= cur_path_->getDropProb() * 10000) {
+ double coin = ((double) rand() / (RAND_MAX));
+ if (coin <= cur_path_->getDropProb()) {
decreaseWindow();
}
}