diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-12-08 10:20:21 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-12-08 10:20:21 -0500 |
commit | 1adc2bf66fedb1768c5013dcf5f4778fae453217 (patch) | |
tree | d46afe4aebd681c9ca50ee5d9e4cf6a6bf7f0da4 | |
parent | b53ff8606714c2f94d251a40c1a073bca760495e (diff) | |
parent | c3d11b119dbd46fa02a1e26d76ddc74424dd4b18 (diff) | |
download | tor-1adc2bf66fedb1768c5013dcf5f4778fae453217.tar.gz tor-1adc2bf66fedb1768c5013dcf5f4778fae453217.zip |
Merge branch 'maint-0.2.5' into maint-0.2.6
-rw-r--r-- | changes/bug17772 | 7 | ||||
-rw-r--r-- | src/or/routerlist.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/changes/bug17772 b/changes/bug17772 new file mode 100644 index 0000000000..54d457c601 --- /dev/null +++ b/changes/bug17772 @@ -0,0 +1,7 @@ + o Major bugfixes (guard selection): + - Actually look at the Guard flag when selecting a new directory + guard. When we implemented the directory guard design, we + accidentally started treating all relays as if they have the Guard + flag during guard selection, leading to weaker anonymity and worse + performance. Fixes bug 17222; bugfix on 0.2.4.8-alpha. Discovered + by Mohsen Imani. diff --git a/src/or/routerlist.c b/src/or/routerlist.c index f4f6200bbc..af8e68e880 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1501,8 +1501,14 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, if ((type & MICRODESC_DIRINFO) && !is_trusted && !node->rs->version_supports_microdesc_cache) continue; - if (for_guard && node->using_as_guard) - continue; /* Don't make the same node a guard twice. */ + /* Don't make the same node a guard twice */ + if (for_guard && node->using_as_guard) { + continue; + } + /* Ensure that a directory guard is actually a guard node. */ + if (for_guard && !node->is_possible_guard) { + continue; + } if (try_excluding && routerset_contains_routerstatus(options->ExcludeNodes, status, country)) { |