diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-05 08:16:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-05 08:16:36 -0400 |
commit | 68d913c49c7aff441fc6671406aee5137f36f620 (patch) | |
tree | 5a1c020e63c472242f2d02a9c92973a69d7eaefb /src/or/routerlist.c | |
parent | 2e5b35db81e867e782086e3d714fcc7882c9c171 (diff) | |
parent | 9aa280cc0c105bc282c3c1c0dee385387251ab12 (diff) | |
download | tor-68d913c49c7aff441fc6671406aee5137f36f620.tar.gz tor-68d913c49c7aff441fc6671406aee5137f36f620.zip |
Merge branch 'feature18483-028-v2-squashed' into maint-0.2.8
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2167ae2bf6..97512d7969 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1687,6 +1687,7 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, const int skip_or = router_skip_or_reachability(options, try_ip_pref); const int skip_dir = router_skip_dir_reachability(options, try_ip_pref); + const int must_have_or = directory_must_use_begindir(options); /* Find all the running dirservers we know about. */ SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), const node_t *, node) { @@ -1743,9 +1744,9 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags, try_ip_pref)) smartlist_add(is_trusted ? trusted_tunnel : is_overloaded ? overloaded_tunnel : tunnel, (void*)node); - else if (skip_dir || + else if (!must_have_or && (skip_dir || fascist_firewall_allows_rs(status, FIREWALL_DIR_CONNECTION, - try_ip_pref)) + try_ip_pref))) smartlist_add(is_trusted ? trusted_direct : is_overloaded ? overloaded_direct : direct, (void*)node); } SMARTLIST_FOREACH_END(node); @@ -1849,6 +1850,7 @@ router_pick_trusteddirserver_impl(const smartlist_t *sourcelist, const int skip_or = router_skip_or_reachability(options, try_ip_pref); const int skip_dir = router_skip_dir_reachability(options, try_ip_pref); + const int must_have_or = directory_must_use_begindir(options); SMARTLIST_FOREACH_BEGIN(sourcelist, const dir_server_t *, d) { @@ -1888,9 +1890,9 @@ router_pick_trusteddirserver_impl(const smartlist_t *sourcelist, fascist_firewall_allows_dir_server(d, FIREWALL_OR_CONNECTION, try_ip_pref)) smartlist_add(is_overloaded ? overloaded_tunnel : tunnel, (void*)d); - else if (skip_dir || + else if (!must_have_or && (skip_dir || fascist_firewall_allows_dir_server(d, FIREWALL_DIR_CONNECTION, - try_ip_pref)) + try_ip_pref))) smartlist_add(is_overloaded ? overloaded_direct : direct, (void*)d); } SMARTLIST_FOREACH_END(d); |