aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-09 10:16:48 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-09 10:16:48 -0400
commit83de46eb2536f17dbe6c96533e8751b5a1ebe984 (patch)
tree3d69bcb5a1bfb5eae65553196b00265df29a5916 /src/feature/nodelist/routerlist.c
parent7746b071d8c8bd3d1175fa02a149d099bf082399 (diff)
downloadtor-83de46eb2536f17dbe6c96533e8751b5a1ebe984.tar.gz
tor-83de46eb2536f17dbe6c96533e8751b5a1ebe984.zip
Changes file and comment for 25928.
Diffstat (limited to 'src/feature/nodelist/routerlist.c')
-rw-r--r--src/feature/nodelist/routerlist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index be58a7a074..12226fee64 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -1806,8 +1806,11 @@ router_pick_dirserver_generic(smartlist_t *sourcelist,
const routerstatus_t *choice;
int busy = 0;
- if (smartlist_len(sourcelist) == 1)
+ if (smartlist_len(sourcelist) == 1) {
+ /* If there's only one choice, then we should disable the logic that
+ * would otherwise prevent us from choosing ourself. */
flags |= PDS_ALLOW_SELF;
+ }
choice = router_pick_trusteddirserver_impl(sourcelist, type, flags, &busy);
if (choice || !(flags & PDS_RETRY_IF_NO_SERVERS))