aboutsummaryrefslogtreecommitdiff
path: root/src/or/entrynodes.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2012-12-09 20:56:48 -0800
committerMike Perry <mikeperry-git@fscked.org>2012-12-09 20:56:48 -0800
commitb75880d7b3d02f5c60bf2e215c6e84da4f3e1938 (patch)
tree0d814f884b617497f0a80539520f6d0acfd5b56d /src/or/entrynodes.c
parent2dbb62f1b571ea57af111f1f660a5149d160c4fb (diff)
downloadtor-b75880d7b3d02f5c60bf2e215c6e84da4f3e1938.tar
tor-b75880d7b3d02f5c60bf2e215c6e84da4f3e1938.tar.gz
Fix a rather serious use-count state bug.
We need to use the success count or the use count depending on the consensus parameter.
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r--src/or/entrynodes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 21c09f79c..96b075a35 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1065,8 +1065,8 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
/* Note: We rely on the < comparison here to allow us to set a 0
* rate and disable the feature entirely. If refactoring, don't
* change to <= */
- if ((node->circ_successes/((double)node->circ_attempts)
- < pathbias_get_extreme_rate(options)) &&
+ if (pathbias_get_success_count(node)/node->circ_attempts
+ < pathbias_get_extreme_rate(options) &&
pathbias_get_dropguards(options)) {
node->path_bias_disabled = 1;
log_info(LD_GENERAL,