summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-10-29 15:55:39 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-29 15:55:39 -0400
commitda0912c00c993b62040f33d2fa57637f010eb7e4 (patch)
tree2108eb8de3a17d8965a2eb99f43e253b1b1786f9 /src/or/circuitbuild.c
parentccec0a1bd37369867f48cd463373d8dd48db5a68 (diff)
downloadtor-da0912c00c993b62040f33d2fa57637f010eb7e4.tar.gz
tor-da0912c00c993b62040f33d2fa57637f010eb7e4.zip
Fix up comments in choose_good_entry_server. Spotted by Robert Ransom.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index f8a198bb71..20a7a0d074 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -3022,23 +3022,28 @@ choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state)
if (state && options->UseEntryGuards &&
(purpose != CIRCUIT_PURPOSE_TESTING || options->BridgeRelay)) {
+ /* This is request for an entry server to use for a regular circuit,
+ * and we use entry guard nodes. Just return one of the guard nodes. */
return choose_random_entry(state);
}
excluded = smartlist_create();
if (state && (node = build_state_get_exit_node(state))) {
+ /* Exclude the exit node from the state, if we have one. Also exclude its
+ * family. */
smartlist_add(excluded, (void*)node);
nodelist_add_node_family(excluded, node);
}
if (firewall_is_fascist_or()) {
+ /* Exclude all ORs that we can't reach through our firewall */
smartlist_t *nodes = nodelist_get_list();
- SMARTLIST_FOREACH(nodes, const node_t *,node, {
+ SMARTLIST_FOREACH(nodes, const node_t *, node, {
if (!fascist_firewall_allows_node(node))
smartlist_add(excluded, (void*)node);
});
}
- /* and exclude current entry guards, if applicable */
+ /* and exclude current entry guards and their families, if applicable */
if (options->UseEntryGuards && entry_guards) {
SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
{