aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArlo Breault <arlolra@gmail.com>2015-12-07 20:28:26 -0800
committerNick Mathewson <nickm@torproject.org>2015-12-08 09:49:01 -0500
commit5138f5ca6957166febe98d5b6841936d7c20d0ad (patch)
treeb0e7f7616c1dc3c4f3c2ec5634bc5f649843d052 /src
parentb0867fec964a8692e9c605da82b3a3393eeaf451 (diff)
downloadtor-5138f5ca6957166febe98d5b6841936d7c20d0ad.tar.gz
tor-5138f5ca6957166febe98d5b6841936d7c20d0ad.zip
Ensure node is a guard candidate when picking a directory guard
Diffstat (limited to 'src')
-rw-r--r--src/or/routerlist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 8fe496b51e..9ad763c4d1 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1537,8 +1537,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)) {