diff options
author | George Kadianakis <desnacked@riseup.net> | 2014-09-15 15:27:27 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2014-09-15 16:07:48 +0300 |
commit | 3e7c5e9f4464e5ca5f33f1206af72580b9dc4e20 (patch) | |
tree | 6651ca67fa52b36281aee083cfb9a4db35915914 /src/or/circuituse.c | |
parent | e02138eb65a71af8eb0de9077a82aa25eb0ac03e (diff) | |
download | tor-3e7c5e9f4464e5ca5f33f1206af72580b9dc4e20.tar.gz tor-3e7c5e9f4464e5ca5f33f1206af72580b9dc4e20.zip |
Block circuit canibalization when Tor2webRendezvousPoints is active.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index bd42bd39cb..6304a4dedf 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -1646,6 +1646,7 @@ circuit_launch_by_extend_info(uint8_t purpose, { origin_circuit_t *circ; int onehop_tunnel = (flags & CIRCLAUNCH_ONEHOP_TUNNEL) != 0; + int need_specific_rp = 0; if (!onehop_tunnel && !router_have_minimum_dir_info()) { log_debug(LD_CIRC,"Haven't fetched enough directory info yet; canceling " @@ -1653,8 +1654,17 @@ circuit_launch_by_extend_info(uint8_t purpose, return NULL; } + /* If Tor2webRendezvousPoints is enabled and we are dealing with an + RP circuit, we want a specific RP node so we shouldn't canibalize + an already existing circuit. */ + if (get_options()->Tor2webRendezvousPoints && + purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND) { + need_specific_rp = 1; + } + if ((extend_info || purpose != CIRCUIT_PURPOSE_C_GENERAL) && - purpose != CIRCUIT_PURPOSE_TESTING && !onehop_tunnel) { + purpose != CIRCUIT_PURPOSE_TESTING && + !onehop_tunnel && !need_specific_rp) { /* see if there are appropriate circs available to cannibalize. */ /* XXX if we're planning to add a hop, perhaps we want to look for * internal circs rather than exit circs? -RD */ |