Commit 60e27a7b authored by Mike Perry's avatar Mike Perry
Browse files

Fix route_len_for_purpose(). Much easier with service vg-lite

Unit tests now pass.
parent eb3eed32
Pipeline #5618 failed with stage
in 11 minutes and 37 seconds
......@@ -1359,8 +1359,9 @@ route_len_for_purpose(uint8_t purpose, extend_info_t *exit_ei)
int routelen = DEFAULT_ROUTE_LEN;
int known_purpose = 0;
/* XXX: If vanguards-lite only uses L2, this check needs to change */
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
......@@ -1375,14 +1376,6 @@ route_len_for_purpose(uint8_t purpose, extend_info_t *exit_ei)
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment