diff options
author | teor <teor@torproject.org> | 2019-08-23 14:54:15 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-08-23 15:02:20 +1000 |
commit | 144084d6facc3d688c7d423a8b5b8da5e26de84c (patch) | |
tree | 3939210f65e0f636f3547ba6611c9cb26af7a42d /src | |
parent | dc08f8ac70e95b9a76f86a5e15dfcabd7ada25b9 (diff) | |
download | tor-144084d6facc3d688c7d423a8b5b8da5e26de84c.tar.gz tor-144084d6facc3d688c7d423a8b5b8da5e26de84c.zip |
rendservice: Always use a 3-hop path when a v2 single onion intro fails
Previously, we always used a 1-hop path, no matter how many times a v2
single onion intro failed.
Fixes bug 23818; bugfix on 0.2.9.3-alpha.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/rendservice.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index f145e9d694..ca1be5e5de 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -3041,8 +3041,15 @@ rend_service_launch_establish_intro(rend_service_t *service, extend_info_t *launch_ei = intro->extend_info; extend_info_t *direct_ei = NULL; - /* Are we in single onion mode? */ - if (rend_service_allow_non_anonymous_connection(options)) { + /* Are we in single onion mode? + * + * We only use a one-hop path on the first attempt. If the first attempt + * fails, we use a 3-hop path for reachability / reliability. + * (Unlike v3, retries is incremented by the caller after it calls this + * function.) + */ + if (rend_service_allow_non_anonymous_connection(options) && + intro->circuit_retries == 0) { /* Do we have a descriptor for the node? * We've either just chosen it from the consensus, or we've just reviewed * our intro points to see which ones are still valid, and deleted the ones |