summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-09-29 09:36:42 +0000
committerRoger Dingledine <arma@torproject.org>2008-09-29 09:36:42 +0000
commitc846979ab720a2f95dd7a3ef3bc10d9befa4ff3a (patch)
tree2afd5a6dec3004706d359bf2ca6f5f5356aae56e
parent81b216086bb2c3e8c3436d750f65c91f1f031a15 (diff)
downloadtor-c846979ab720a2f95dd7a3ef3bc10d9befa4ff3a.tar.gz
tor-c846979ab720a2f95dd7a3ef3bc10d9befa4ff3a.zip
Fix a bug where an unreachable relay would establish enough
reachability testing circuits to do a bandwidth test -- if we already have a connection to the middle hop of the testing circuit, then it could establish the last hop by using the existing connection. Bugfix on 0.1.2.2-alpha, exposed when we made testing circuits no longer use entry guards in 0.2.1.3-alpha. svn:r16997
-rw-r--r--ChangeLog6
-rw-r--r--src/or/circuituse.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fd12dc767..dcadbf813d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,12 @@ Changes in version 0.2.1.6-alpha - 2008-09-29
- Make DNS resolved controller events into "CLOSED", not
"FAILED". Bugfix on 0.1.2.5-alpha. Fix by Robert Hogan. Resolves
bug 807.
+ - Fix a bug where an unreachable relay would establish enough
+ reachability testing circuits to do a bandwidth test -- if
+ we already have a connection to the middle hop of the testing
+ circuit, then it could establish the last hop by using the existing
+ connection. Bugfix on 0.1.2.2-alpha, exposed when we made testing
+ circuits no longer use entry guards in 0.2.1.3-alpha.
o Code simplifications and refactoring:
- Revise the connection_new functions so that a more typesafe variant
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index e0c855407a..62ced088b5 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -680,7 +680,12 @@ circuit_enough_testing_circs(void)
static void
circuit_testing_opened(origin_circuit_t *circ)
{
- if (have_performed_bandwidth_test) {
+ if (have_performed_bandwidth_test ||
+ !check_whether_orport_reachable()) {
+ /* either we've already done everything we want with testing circuits,
+ * or this testing circuit became open due to a fluke, e.g. we picked
+ * a last hop where we already had the connection open due to an
+ * outgoing local circuit. */
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_AT_ORIGIN);
} else if (circuit_enough_testing_circs()) {
router_perform_bandwidth_test(NUM_PARALLEL_TESTING_CIRCS, time(NULL));