summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-02 12:55:56 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-02 12:55:56 -0400
commit385c59798af80e2609b66afb2998acb508060f95 (patch)
tree56cb6fb3a87a9d81fbd28eef6201c4e07731c756 /src/or
parentdf42eb0a18a9f6fe4b729a1c9a63bb6ab247f631 (diff)
parent7039c34519e29a18081a9bc7f3c957c473c70bc4 (diff)
downloadtor-385c59798af80e2609b66afb2998acb508060f95.tar.gz
tor-385c59798af80e2609b66afb2998acb508060f95.zip
Merge remote-tracking branch 'arma/bug3321' into maint-0.2.2
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 2f70b67d23..3f08448159 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -3383,6 +3383,8 @@ entry_guard_set_status(entry_guard_t *e, routerinfo_t *ri,
*reason = "down";
else if (options->UseBridges && ri->purpose != ROUTER_PURPOSE_BRIDGE)
*reason = "not a bridge";
+ else if (options->UseBridges && !routerinfo_is_a_configured_bridge(ri))
+ *reason = "not a configured bridge";
else if (!options->UseBridges && !ri->is_possible_guard &&
!routerset_contains_router(options->EntryNodes,ri))
*reason = "not recommended as a guard";
@@ -3467,11 +3469,16 @@ entry_is_live(entry_guard_t *e, int need_uptime, int need_capacity,
*msg = "no descriptor";
return NULL;
}
- if (get_options()->UseBridges && r->purpose != ROUTER_PURPOSE_BRIDGE) {
- *msg = "not a bridge";
- return NULL;
- }
- if (!get_options()->UseBridges && r->purpose != ROUTER_PURPOSE_GENERAL) {
+ if (options->UseBridges) {
+ if (r->purpose != ROUTER_PURPOSE_BRIDGE) {
+ *msg = "not a bridge";
+ return NULL;
+ }
+ if (!routerinfo_is_a_configured_bridge(r)) {
+ *msg = "not a configured bridge";
+ return NULL;
+ }
+ } else if (r->purpose != ROUTER_PURPOSE_GENERAL) {
*msg = "not general-purpose";
return NULL;
}