summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-28 23:57:56 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-28 23:57:56 +0000
commit1a444e089a9bbe840c9b14ddabe515461cb56575 (patch)
treeba08b996b05de524790a8554d6ced3ac230b2821 /src/or
parentd174cccd0b4878ed2e7fd69081e588d9bc98e802 (diff)
downloadtor-1a444e089a9bbe840c9b14ddabe515461cb56575.tar.gz
tor-1a444e089a9bbe840c9b14ddabe515461cb56575.zip
r8976@Kushana: nickm | 2006-09-28 17:18:57 -0400
Another tweak to guard logic: ignore check for the Guard flag if a server is listed on EntryNodes. (Also remove redundant checks for always-set variables.) svn:r8522
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 5a320abf53..d9d16d6188 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1732,15 +1732,17 @@ entry_guard_set_status(entry_guard_t *e, routerinfo_t *ri,
char buf[HEX_DIGEST_LEN+1];
int changed = 0;
+ tor_assert(options);
+
/* Do we want to mark this guard as bad? */
if (!ri)
reason = "unlisted";
else if (!ri->is_running)
reason = "down";
- else if (!ri->is_possible_guard)
+ else if (!ri->is_possible_guard &&
+ !router_nickname_is_in_list(ri, options->EntryNodes))
reason = "not recommended as a guard";
- else if (options && ri &&
- router_nickname_is_in_list(ri, options->ExcludeNodes))
+ else if (router_nickname_is_in_list(ri, options->ExcludeNodes))
reason = "excluded";
if (reason && ! e->bad_since) {