|
@@ -1501,8 +1501,14 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
|
|
if ((type & EXTRAINFO_DIRINFO) &&
|
|
if ((type & EXTRAINFO_DIRINFO) &&
|
|
!router_supports_extrainfo(node->identity, is_trusted_extrainfo))
|
|
!router_supports_extrainfo(node->identity, is_trusted_extrainfo))
|
|
continue;
|
|
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 &&
|
|
if (try_excluding &&
|
|
routerset_contains_routerstatus(options->ExcludeNodes, status,
|
|
routerset_contains_routerstatus(options->ExcludeNodes, status,
|
|
country)) {
|
|
country)) {
|