Merge branch 'tor-github/pr/1953'

This commit is contained in:
David Goulet
2020-07-01 09:47:26 -04:00
5 changed files with 27 additions and 6 deletions
+7
View File
@@ -44,6 +44,13 @@ CONF_VAR(AuthDirSharedRandomness, BOOL, 0, "1")
/* NOTE: remove this option someday. */
CONF_VAR(AuthDirTestEd25519LinkKeys, BOOL, 0, "1")
/**
* Bool (default 1): As an authority, should we launch tests for
* reachability, and use those results to vote on "Running"? If 0,
* we assume that every relay is Runnning.
**/
CONF_VAR(AuthDirTestReachability, BOOL, 0, "1")
/** Authority only: key=value pairs that we add to our networkstatus
* consensus vote on the 'params' line. */
CONF_VAR(ConsensusParams, STRING, 0, NULL)
+5
View File
@@ -105,6 +105,8 @@ dirserv_should_launch_reachability_test(const routerinfo_t *ri,
{
if (!authdir_mode_handles_descs(get_options(), ri->purpose))
return 0;
if (! dirauth_get_options()->AuthDirTestReachability)
return 0;
if (!ri_old) {
/* New router: Launch an immediate reachability test, so we will have an
* opinion soon in case we're generating a consensus soon */
@@ -189,6 +191,9 @@ dirserv_test_reachability(time_t now)
* the testing, and directory authorities are easy to upgrade. Let's
* wait til 0.2.0. -RD */
// time_t cutoff = now - ROUTER_MAX_AGE_TO_PUBLISH;
if (! dirauth_get_options()->AuthDirTestReachability)
return;
routerlist_t *rl = router_get_routerlist();
static char ctr = 0;
int bridge_auth = authdir_mode_bridge(get_options());
+3 -3
View File
@@ -487,7 +487,6 @@ dirserv_set_router_is_running(routerinfo_t *router, time_t now)
unreachable.
*/
int answer;
const or_options_t *options = get_options();
const dirauth_options_t *dirauth_options = dirauth_get_options();
node_t *node = node_get_mutable_by_id(router->cache_info.identity_digest);
tor_assert(node);
@@ -501,8 +500,9 @@ dirserv_set_router_is_running(routerinfo_t *router, time_t now)
/* A hibernating router is down unless we (somehow) had contact with it
* since it declared itself to be hibernating. */
answer = 0;
} else if (options->AssumeReachable) {
/* If AssumeReachable, everybody is up unless they say they are down! */
} else if (! dirauth_options->AuthDirTestReachability) {
/* If we aren't testing reachability, then everybody is up unless they say
* they are down. */
answer = 1;
} else {
/* Otherwise, a router counts as up if we found all announced OR