From 4c1c2a313dcd3638eededd4a1a83ed5f0b8b9fed Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 13 May 2015 04:10:39 +1000 Subject: Add Fallback Directory Candidate Selection Script "Tor has included a feature to fetch the initial consensus from nodes other than the authorities for a while now. We just haven't shipped a list of alternate locations for clients to go to yet. Reasons why we might want to ship tor with a list of additional places where clients can find the consensus is that it makes authority reachability and BW less important. We want them to have been around and using their current key, address, and port for a while now (120 days), and have been running, a guard, and a v2 directory mirror for most of that time." Features: * whitelist and blacklist for an opt-in/opt-out trial. * excludes BadExits, tor versions that aren't recommended, and low consensus weight directory mirrors. * reduces the weighting of Exits to avoid overloading them. * places limits on the weight of any one fallback. * includes an IPv6 address and orport for each FallbackDir, as implemented in #17327. (Tor won't bootstrap using IPv6 fallbacks until #17840 is merged.) * generated output includes timestamps & Onionoo URL for traceability. * unit test ensures that we successfully load all included default fallback directories. Closes ticket #15775. Patch by "teor". OnionOO script by "weasel", "teor", "gsathya", and "karsten". --- src/or/routerlist.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/or/routerlist.c') diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 5e7906475f..638c6c551d 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1295,8 +1295,8 @@ router_get_fallback_dir_servers(void) /** Try to find a running dirserver that supports operations of type. * * If there are no running dirservers in our routerlist and the - * PDS_RETRY_IF_NO_SERVERS flag is set, set all the authoritative ones - * as running again, and pick one. + * PDS_RETRY_IF_NO_SERVERS flag is set, set all the fallback ones + * (including authorities) as running again, and pick one. * * If the PDS_IGNORE_FASCISTFIREWALL flag is set, then include * dirservers that we can't reach. @@ -1304,8 +1304,9 @@ router_get_fallback_dir_servers(void) * If the PDS_ALLOW_SELF flag is not set, then don't include ourself * (if we're a dirserver). * - * Don't pick an authority if any non-authority is viable; try to avoid using - * servers that have returned 503 recently. + * Don't pick a fallback directory mirror if any non-fallback is viable; + * (the fallback directory mirrors include the authorities) + * try to avoid using servers that have returned 503 recently. */ const routerstatus_t * router_pick_directory_server(dirinfo_type_t type, int flags) @@ -1332,7 +1333,7 @@ router_pick_directory_server(dirinfo_type_t type, int flags) log_info(LD_DIR, "No reachable router entries for dirservers. " "Trying them all again."); - /* mark all authdirservers as up again */ + /* mark all fallback directory mirrors as up again */ mark_all_dirservers_up(fallback_dir_servers); /* try again */ choice = router_pick_directory_server_impl(type, flags, NULL); -- cgit v1.2.3-54-g00ecf