aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuitbuild.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2021-07-01 17:52:58 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2021-07-01 18:15:55 +0300
commit9afd9d09404200ed149abeeaad9efd3a1542f7e0 (patch)
tree740d2fdf7fd108c00b7ec35ae3d601c018117de2 /src/core/or/circuitbuild.c
parent0240c00929dff8451b42ef313f5345e15ce4da06 (diff)
downloadtor-9afd9d09404200ed149abeeaad9efd3a1542f7e0.tar.gz
tor-9afd9d09404200ed149abeeaad9efd3a1542f7e0.zip
Special vanguard L3 increased path length does not apply for vanguards-lite
Co-authored-by: Mike Perry <mikeperry-git@torproject.org>
Diffstat (limited to 'src/core/or/circuitbuild.c')
-rw-r--r--src/core/or/circuitbuild.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index c1667d7260..5cb647bd02 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -1359,7 +1359,9 @@ route_len_for_purpose(uint8_t purpose, extend_info_t *exit_ei)
int routelen = DEFAULT_ROUTE_LEN;
int known_purpose = 0;
- if (circuit_should_use_vanguards(purpose)) {
+ /* If we're using L3 vanguards, we need longer paths for onion services */
+ if (circuit_purpose_is_hidden_service(purpose) &&
+ get_options()->HSLayer3Nodes) {
/* Clients want an extra hop for rends to avoid linkability.
* Services want it for intro points to avoid publishing their
* layer3 guards. They want it for hsdir posts to use
@@ -1374,14 +1376,6 @@ route_len_for_purpose(uint8_t purpose, extend_info_t *exit_ei)
purpose == CIRCUIT_PURPOSE_S_ESTABLISH_INTRO)
return routelen+1;
- /* If we only have Layer2 vanguards, then we do not need
- * the extra hop for linkabilty reasons (see below).
- * This means all hops can be of the form:
- * S/C - G - L2 - M - R/HSDir/I
- */
- if (get_options()->HSLayer2Nodes && !get_options()->HSLayer3Nodes)
- return routelen+1;
-
/* For connections to hsdirs, clients want two extra hops
* when using layer3 guards, to avoid linkability.
* Same goes for intro points. Note that the route len