From 246fecb585cef56af5a0c4bf08365d2d040c3c73 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 3 Oct 2006 05:45:58 +0000 Subject: the other half of the is_local_IP patch svn:r8581 --- src/or/circuitbuild.c | 1 + src/or/config.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a8ac76e42..f2eda22dc 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1443,6 +1443,7 @@ compute_preferred_testing_list(const char *answer) ((tor_version_as_new_as(r->platform,"0.1.1.21-cvs") && !tor_version_as_new_as(r->platform,"0.1.2.0-alpha-cvs")) || tor_version_as_new_as(r->platform,"0.1.2.1-alpha")) && + !is_local_IP(r->addr) && !router_get_trusteddirserver_by_digest(r->cache_info.identity_digest)) smartlist_add(choices, r)); router = smartlist_choose(choices); diff --git a/src/or/config.c b/src/or/config.c index a4c53d4ca..7b7628830 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1729,9 +1729,10 @@ is_local_IP(uint32_t ip) { if (is_internal_IP(ip, 0)) return 1; - /* Check whether ip is on the same /24 as we are. - * - * It's possible that this next check will hit before the first time + /* Check whether ip is on the same /24 as we are. */ + if (get_options()->EnforceDistinctSubnets == 0) + return 0; + /* It's possible that this next check will hit before the first time * resolve_my_address actually succeeds. (For clients, it is likely that * resolve_my_address will never be called at all). In those cases, * last_resolved_addr will be 0, and so checking to see whether ip is on the -- cgit v1.2.3