aboutsummaryrefslogtreecommitdiff
path: root/src/feature/client
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-05-31 12:19:29 -0400
committerNick Mathewson <nickm@torproject.org>2019-05-31 12:28:42 -0400
commit8015979eeba2c8b10fb058318628debf228fb023 (patch)
treeae2fc7cb64e9702f2161823367ff0902691d62c0 /src/feature/client
parent5b3c8865842f3b12d3ea35db19e8feb135bb46dc (diff)
downloadtor-8015979eeba2c8b10fb058318628debf228fb023.tar.gz
tor-8015979eeba2c8b10fb058318628debf228fb023.zip
num_bridges_usable(): only count configured bridges.
When this function was implemented, it counted all the entry guards in the bridge set. But this included previously configured bridges, as well as currently configured ones! Instead, only count the _filtered_ bridges (ones that are configured and possibly reachable) as maybe usable. Fixes bug 29875; bugfix on 0.3.0.1-alpha.
Diffstat (limited to 'src/feature/client')
-rw-r--r--src/feature/client/entrynodes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index e543289ce0..15ec830594 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -3300,6 +3300,9 @@ num_bridges_usable,(int use_maybe_reachable))
}
SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) {
+ /* Not a bridge, or not one we are configured to be able to use. */
+ if (! guard->is_filtered_guard)
+ continue;
/* Definitely not usable */
if (guard->is_reachable == GUARD_REACHABLE_NO)
continue;