diff options
author | teor <teor2345@gmail.com> | 2014-12-20 21:44:16 +1100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-12-30 09:06:00 -0500 |
commit | 2b8e1f91336db7297803f4e7d2f324d6960a676c (patch) | |
tree | 319fe550f5023ba6468a7f680fa673e00ef6e843 /src/or/circuitbuild.c | |
parent | c3a4201faa389ce95b263045a855a556be25f3f2 (diff) | |
download | tor-2b8e1f91336db7297803f4e7d2f324d6960a676c.tar.gz tor-2b8e1f91336db7297803f4e7d2f324d6960a676c.zip |
Fix Reachability self-tests in test networks
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.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a834e7b7fc..7061ab0e0b 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -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. */ |