diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-04 12:23:20 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-04 12:25:43 -0500 |
commit | 2e9cd4b7241719abe6f6dfd6ed4c1ad1c1054034 (patch) | |
tree | 4281824c93cf78af7ab08df34082c070ea53f5c5 /src/or | |
parent | 898f2d7c278442d2c4fbdf0126eaa406d503d088 (diff) | |
download | tor-2e9cd4b7241719abe6f6dfd6ed4c1ad1c1054034.tar tor-2e9cd4b7241719abe6f6dfd6ed4c1ad1c1054034.tar.gz |
Quick fix on 5956 for authorities
Authorities don't set is_possible_guard on node_t, so they were
never deciding that they could build enough paths. This is a quick
and dirty fix.
Bug not in any released version of Tor
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/nodelist.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 9f77dcafe..ee1bc392e 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -1313,6 +1313,7 @@ compute_frac_paths_available(const networkstatus_t *consensus, smartlist_t *myexits= smartlist_new(); double f_guard, f_mid, f_exit, f_myexit; int np, nu; /* Ignored */ + const int authdir = authdir_mode_v2(options) || authdir_mode_v3(options); count_usable_descriptors(num_present_out, num_usable_out, mid, consensus, options, now, NULL, 0); @@ -1321,8 +1322,13 @@ compute_frac_paths_available(const networkstatus_t *consensus, options->EntryNodes, 0); } else { SMARTLIST_FOREACH(mid, const node_t *, node, { - if (node->is_possible_guard) - smartlist_add(guards, (node_t*)node); + if (authdir) { + if (node->rs && node->rs->is_possible_guard) + smartlist_add(guards, (node_t*)node); + } else { + if (node->is_possible_guard) + smartlist_add(guards, (node_t*)node); + } }); } |