diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-09-22 15:29:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-08 10:45:18 -0500 |
commit | 3c03e237ab372f495fa2498e925813931ba381da (patch) | |
tree | 01dcb809cff24a7bf4e3ced8fd5862d4707ea5d5 /changes | |
parent | 04d4786cc40b2d80b4cd34e7d5339b0100861c8f (diff) | |
download | tor-3c03e237ab372f495fa2498e925813931ba381da.tar.gz tor-3c03e237ab372f495fa2498e925813931ba381da.zip |
Remove an erroneous 0.5 in compute_weighted_bandwidths()
Back in 0.2.4.3-alpha (e106812a778f537), when we switched from using
double to using uint64 for selecting by bandwidth, I got the math
wrong: I should have used llround(x), or (uint64_t)(x+0.5), but
instead I wrote llround(x+0.5). That means we would always round
up, rather than rounding to the closest integer
Fixes bug 23318; bugfix on 0.2.4.3-alpha.
Diffstat (limited to 'changes')
-rw-r--r-- | changes/bug23318 | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/changes/bug23318 b/changes/bug23318 new file mode 100644 index 0000000000..32c85eb194 --- /dev/null +++ b/changes/bug23318 @@ -0,0 +1,7 @@ + o Minor bugfixes (path selection): + - When selecting relays by bandwidth, avoid a rounding error that + could sometimes cause load to be imbalanced incorrectly. Previously, + we would always round upwards; now, we round towards the nearest + integer. This had the biggest effect when a relay's weight adjustments + should have given it weight 0, but it got weight 1 instead. + Fixes bug 23318; bugfix on 0.2.4.3-alpha. |