Kaynağa Gözat

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

Roger Dingledine 15 yıl önce
ebeveyn
işleme
c846979ab7
2 değiştirilmiş dosya ile 12 ekleme ve 1 silme
  1. 6 0
      ChangeLog
  2. 6 1
      src/or/circuituse.c

+ 6 - 0
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

+ 6 - 1
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));