[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r16997: {tor} Fix a bug where an unreachable relay would establish enough (in tor/trunk: . src/or)
Author: arma
Date: 2008-09-29 05:36:42 -0400 (Mon, 29 Sep 2008)
New Revision: 16997
Modified:
tor/trunk/ChangeLog
tor/trunk/src/or/circuituse.c
Log:
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.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2008-09-29 09:30:06 UTC (rev 16996)
+++ tor/trunk/ChangeLog 2008-09-29 09:36:42 UTC (rev 16997)
@@ -93,6 +93,12 @@
- 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
Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c 2008-09-29 09:30:06 UTC (rev 16996)
+++ tor/trunk/src/or/circuituse.c 2008-09-29 09:36:42 UTC (rev 16997)
@@ -680,7 +680,12 @@
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));