summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-11 09:48:38 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-11 09:48:38 -0400
commit3799ce7970a5d1fe21ce2921c763f06e4369cfee (patch)
tree2857b7527746c518f0e340e4d483f62dd856c45b
parent7dcd105be34a4f44948383d21b5ee2eb4a3cbdd2 (diff)
parent64c8e8edda5a7f3525a1ab365c4bd72b19212322 (diff)
downloadtor-3799ce7970a5d1fe21ce2921c763f06e4369cfee.tar.gz
tor-3799ce7970a5d1fe21ce2921c763f06e4369cfee.zip
Merge branch 'bug2797'
-rw-r--r--src/or/circuitbuild.c6
-rw-r--r--src/or/connection_edge.c3
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/rendclient.c2
-rw-r--r--src/or/rendservice.c2
-rw-r--r--src/or/routerlist.c7
6 files changed, 10 insertions, 12 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 4ec45bc08f..90d92802ea 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2693,8 +2693,7 @@ choose_good_exit_server_general(int need_uptime, int need_capacity)
n_supported[i] = -1;
continue; /* skip routers that are known to be down or bad exits */
}
- if (options->_ExcludeExitNodesUnion &&
- routerset_contains_node(options->_ExcludeExitNodesUnion, node)) {
+ if (routerset_contains_node(options->_ExcludeExitNodesUnion, node)) {
n_supported[i] = -1;
continue; /* user asked us not to use it, no matter what */
}
@@ -3505,8 +3504,7 @@ entry_is_live(entry_guard_t *e, int need_uptime, int need_capacity,
return NULL;
}
}
- if (options->EntryNodes &&
- routerset_contains_node(options->EntryNodes, node)) {
+ if (routerset_contains_node(options->EntryNodes, node)) {
/* they asked for it, they get it */
need_uptime = need_capacity = 0;
}
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index c490148485..3f6e87cb20 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -3146,8 +3146,7 @@ connection_ap_can_use_exit(edge_connection_t *conn, const node_t *exit)
if (!conn->chosen_exit_name && node_exit_policy_rejects_all(exit))
return 0;
}
- if (options->_ExcludeExitNodesUnion &&
- routerset_contains_node(options->_ExcludeExitNodesUnion, exit)) {
+ if (routerset_contains_node(options->_ExcludeExitNodesUnion, exit)) {
/* Not a suitable exit. Refuse it. */
return 0;
}
diff --git a/src/or/directory.c b/src/or/directory.c
index 9e1373d46f..17413edeb3 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -306,7 +306,7 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
if (exclude_self && router_digest_is_me(ds->digest))
continue;
- if (options->ExcludeNodes && options->StrictNodes &&
+ if (options->StrictNodes &&
routerset_contains_routerstatus(options->ExcludeNodes, rs, -1)) {
log_warn(LD_DIR, "Wanted to contact authority '%s' for %s, but "
"it's in our ExcludedNodes list and StrictNodes is set. "
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index b618d0fe4f..516455983c 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -948,7 +948,7 @@ rend_client_get_random_intro_impl(const rend_cache_entry_t *entry,
intro->extend_info = extend_info_from_node(node);
}
/* Check if we should refuse to talk to this router. */
- if (options->ExcludeNodes && strict &&
+ if (strict &&
routerset_contains_extendinfo(options->ExcludeNodes,
intro->extend_info)) {
n_excluded++;
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 4413ae9d83..47a9fc7276 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1079,7 +1079,7 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
}
/* Check if we'd refuse to talk to this router */
- if (options->ExcludeNodes && options->StrictNodes &&
+ if (options->StrictNodes &&
routerset_contains_extendinfo(options->ExcludeNodes, extend_info)) {
log_warn(LD_REND, "Client asked to rendezvous at a relay that we "
"exclude, and StrictNodes is set. Refusing service.");
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 15f643cf79..00557a26e9 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1132,7 +1132,7 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags)
if ((type & MICRODESC_DIRINFO) && !is_trusted &&
!node->rs->version_supports_microdesc_cache)
continue;
- if (try_excluding && options->ExcludeNodes &&
+ if (try_excluding &&
routerset_contains_routerstatus(options->ExcludeNodes, status,
country)) {
++n_excluded;
@@ -1237,7 +1237,7 @@ router_pick_trusteddirserver_impl(dirinfo_type_t type, int flags,
continue;
if (requireother && me && router_digest_is_me(d->digest))
continue;
- if (try_excluding && options->ExcludeNodes &&
+ if (try_excluding &&
routerset_contains_routerstatus(options->ExcludeNodes,
&d->fake_status, -1)) {
++n_excluded;
@@ -5567,7 +5567,8 @@ routerset_contains(const routerset_t *set, const tor_addr_t *addr,
const char *nickname, const char *id_digest,
country_t country)
{
- if (!set || !set->list) return 0;
+ if (!set || !set->list)
+ return 0;
if (nickname && strmap_get_lc(set->names, nickname))
return 4;
if (id_digest && digestmap_get(set->digests, id_digest))