aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-05-05 11:51:37 +1000
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-05-05 11:54:53 +1000
commit2e5b35db81e867e782086e3d714fcc7882c9c171 (patch)
tree191cea217d5ba071b8a88fd40395a2710d3c0fe1 /src/or/routerlist.c
parent01e7f42a09108e71cede46d4a038c4b1253a3d42 (diff)
downloadtor-2e5b35db81e867e782086e3d714fcc7882c9c171.tar.gz
tor-2e5b35db81e867e782086e3d714fcc7882c9c171.zip
Make directory node selection more reliable
Delete an unnecessary check for non-preferred IP versions. Allows clients which can't reach any directories of their preferred IP address version to get directory documents. Patch on #17840 in 0.2.8.1-alpha.
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 3c9023e8f0..2167ae2bf6 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1597,11 +1597,10 @@ router_picked_poor_directory_log(const routerstatus_t *rs)
STMT_BEGIN \
if (result == NULL && try_ip_pref && options->ClientUseIPv4 \
&& fascist_firewall_use_ipv6(options) && !server_mode(options) \
- && n_not_preferred && !n_busy) { \
+ && !n_busy) { \
n_excluded = 0; \
n_busy = 0; \
try_ip_pref = 0; \
- n_not_preferred = 0; \
goto retry_label; \
} \
STMT_END \
@@ -1620,7 +1619,6 @@ router_picked_poor_directory_log(const routerstatus_t *rs)
n_excluded = 0; \
n_busy = 0; \
try_ip_pref = 1; \
- n_not_preferred = 0; \
goto retry_label; \
} \
STMT_END
@@ -1673,7 +1671,7 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
const int no_microdesc_fetching = (flags & PDS_NO_EXISTING_MICRODESC_FETCH);
const int for_guard = (flags & PDS_FOR_GUARD);
int try_excluding = 1, n_excluded = 0, n_busy = 0;
- int try_ip_pref = 1, n_not_preferred = 0;
+ int try_ip_pref = 1;
if (!consensus)
return NULL;
@@ -1750,8 +1748,6 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
try_ip_pref))
smartlist_add(is_trusted ? trusted_direct :
is_overloaded ? overloaded_direct : direct, (void*)node);
- else if (!tor_addr_is_null(&status->ipv6_addr))
- ++n_not_preferred;
} SMARTLIST_FOREACH_END(node);
if (smartlist_len(tunnel)) {
@@ -1839,7 +1835,7 @@ router_pick_trusteddirserver_impl(const smartlist_t *sourcelist,
smartlist_t *pick_from;
int n_busy = 0;
int try_excluding = 1, n_excluded = 0;
- int try_ip_pref = 1, n_not_preferred = 0;
+ int try_ip_pref = 1;
if (!sourcelist)
return NULL;
@@ -1896,8 +1892,6 @@ router_pick_trusteddirserver_impl(const smartlist_t *sourcelist,
fascist_firewall_allows_dir_server(d, FIREWALL_DIR_CONNECTION,
try_ip_pref))
smartlist_add(is_overloaded ? overloaded_direct : direct, (void*)d);
- else if (!tor_addr_is_null(&d->ipv6_addr))
- ++n_not_preferred;
}
SMARTLIST_FOREACH_END(d);