From 50c109a578b3f341fe667833398da1c82b343d87 Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Mon, 7 Dec 2015 20:28:26 -0800 Subject: [PATCH] Ensure node is a guard candidate when picking a directory guard --- src/or/routerlist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 8f6a440..7a24bf6 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1501,8 +1501,10 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, if ((type & EXTRAINFO_DIRINFO) && !router_supports_extrainfo(node->identity, is_trusted_extrainfo)) 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 and ensure node can be + used as a guard. */ + if (for_guard && (node->using_as_guard || !node->is_possible_guard)) + continue; if (try_excluding && routerset_contains_routerstatus(options->ExcludeNodes, status, country)) { -- 2.6.3