diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-08-21 10:21:53 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-08-21 10:21:53 -0400 |
commit | d517233e71139e60a1050ca86586f4cf3857b792 (patch) | |
tree | 1f70ed3ec9c406f554cb926376644d3b21e46da6 /src/or/dirserv.c | |
parent | 661bd3fe714f0c9986eb872eb8eb5d72b2efc195 (diff) | |
parent | b1c4b3ad0e1212763dde1447a74c80aaa1557045 (diff) | |
download | tor-d517233e71139e60a1050ca86586f4cf3857b792.tar.gz tor-d517233e71139e60a1050ca86586f4cf3857b792.zip |
Merge remote-tracking branch 'linus/bug6621'
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 041e525fc3..f4ba02b4ad 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -980,6 +980,7 @@ dirserv_set_router_is_running(routerinfo_t *router, time_t now) unreachable. */ int answer; + const or_options_t *options = get_options(); node_t *node = node_get_mutable_by_id(router->cache_info.identity_digest); tor_assert(node); @@ -992,13 +993,23 @@ 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 (get_options()->AssumeReachable) { + } else if (options->AssumeReachable) { /* If AssumeReachable, everybody is up unless they say they are down! */ answer = 1; } else { - /* Otherwise, a router counts as up if we found it reachable in the last - REACHABLE_TIMEOUT seconds. */ - answer = (now < node->last_reachable + REACHABLE_TIMEOUT); + /* Otherwise, a router counts as up if we found all announced OR + ports reachable in the last REACHABLE_TIMEOUT seconds. + + XXX prop186 For now there's always one IPv4 and at most one + IPv6 OR port. + + If we're not on IPv6, don't consider reachability of potential + IPv6 OR port since that'd kill all dual stack relays until a + majority of the dir auths have IPv6 connectivity. */ + answer = (now < node->last_reachable + REACHABLE_TIMEOUT && + (options->AuthDirHasIPv6Connectivity == 0 || + tor_addr_is_null(&router->ipv6_addr) || + now < node->last_reachable6 + REACHABLE_TIMEOUT)); } if (!answer && running_long_enough_to_decide_unreachable()) { @@ -1008,6 +1019,8 @@ dirserv_set_router_is_running(routerinfo_t *router, time_t now) REACHABILITY_TEST_CYCLE_PERIOD seconds, then the router has probably been down since at least that time after we last successfully reached it. + + XXX ipv6 */ time_t when = now; if (node->last_reachable && |