summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-05-31 20:43:55 -0400
committerRoger Dingledine <arma@torproject.org>2011-05-31 20:43:55 -0400
commit7039c34519e29a18081a9bc7f3c957c473c70bc4 (patch)
tree103eccff285107021d52ea4ffc21d7c1dbb31010
parent56771f392e68eb2f78180daab0d8f17c9284ad11 (diff)
downloadtor-7039c34519e29a18081a9bc7f3c957c473c70bc4.tar.gz
tor-7039c34519e29a18081a9bc7f3c957c473c70bc4.zip
fix a bridge edge case similar to 2511
If you had configured a bridge but then switched to a different bridge via the controller, you would still be willing to use the old one.
-rw-r--r--changes/bug33217
-rw-r--r--src/or/circuitbuild.c17
2 files changed, 19 insertions, 5 deletions
diff --git a/changes/bug3321 b/changes/bug3321
new file mode 100644
index 0000000000..3605efce2d
--- /dev/null
+++ b/changes/bug3321
@@ -0,0 +1,7 @@
+ o Minor bugfixes:
+ - In bug 2511 we fixed a case where you could use an unconfigured
+ bridge if you had configured it as a bridge the last time you ran
+ Tor. Now fix another edge case: if you had configured it as a bridge
+ but then switched to a different bridge via the controller, you
+ would still be willing to use the old one. Bugfix on 0.2.0.1-alpha;
+ fixes bug 3321.
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;
}