]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix Reachability self-tests in test networks
authorteor <teor2345@gmail.com>
Sat, 20 Dec 2014 10:44:16 +0000 (21:44 +1100)
committerNick Mathewson <nickm@torproject.org>
Tue, 30 Dec 2014 14:06:00 +0000 (09:06 -0500)
Stop assuming that private addresses are local when checking
reachability in a TestingTorNetwork. Instead, when testing, assume
all OR connections are remote. (This is necessary due to many test
scenarios running all nodes on localhost.)

This assists in bootstrapping a testing Tor network.

Fixes bugs 13718 & 13924.

changes/bug13924-fix-testing-reachability [new file with mode: 0644]
src/or/circuitbuild.c

diff --git a/changes/bug13924-fix-testing-reachability b/changes/bug13924-fix-testing-reachability
new file mode 100644 (file)
index 0000000..914a159
--- /dev/null
@@ -0,0 +1,7 @@
+  o Minor bugfixes:
+    - Stop assuming that private addresses are local when checking
+      reachability in a TestingTorNetwork. Instead, when testing, assume
+      all OR connections are remote. (This is necessary due to many test
+      scenarios running all nodes on localhost.)
+      This assists in bootstrapping a testing Tor network.
+      Fixes bugs 13718 & 13924.
index a834e7b7fcf12ce66d032a9ec7c5be4c66a6c6e8..7061ab0e0b22765c39ee116f3e7431e5e96aa719 100644 (file)
@@ -1378,8 +1378,10 @@ onionskin_answer(or_circuit_t *circ,
   log_debug(LD_CIRC,"Finished sending '%s' cell.",
             circ->is_first_hop ? "created_fast" : "created");
 
-  if (!channel_is_local(circ->p_chan) &&
-      !channel_is_outgoing(circ->p_chan)) {
+  /* Ignore the local bit when testing - many test networks run on local
+   * addresses */
+  if ((!channel_is_local(circ->p_chan) || get_options()->TestingTorNetwork)
+      && !channel_is_outgoing(circ->p_chan)) {
     /* record that we could process create cells from a non-local conn
      * that we didn't initiate; presumably this means that create cells
      * can reach us too. */