diff options
author | Roger Dingledine <arma@torproject.org> | 2021-10-23 20:32:36 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2021-10-28 20:57:28 -0400 |
commit | 7084ec871070e1f01a48b7735367b94abe1feb21 (patch) | |
tree | f211a400620d3f1d1e0183880f4e19d5f916972c | |
parent | f9cb7e3398a8c0941a2c489b16a9e8ef66bc1324 (diff) | |
download | tor-7084ec871070e1f01a48b7735367b94abe1feb21.tar.gz tor-7084ec871070e1f01a48b7735367b94abe1feb21.zip |
don't retry entry guards if they're bridges without descriptors
When we don't yet have a descriptor for one of our bridges, disable
the entry guard retry schedule on that bridge. The entry guard retry
schedule and the bridge descriptor retry schedule can conflict,
e.g. where we mark a bridge as "maybe up" yet we don't try to fetch
its descriptor yet, leading Tor to wait (refusing to do anything)
until it becomes time to fetch the descriptor.
Fixes bug 40497; bugfix on 0.3.0.3-alpha.
-rw-r--r-- | changes/bug40497 | 8 | ||||
-rw-r--r-- | src/feature/client/entrynodes.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/changes/bug40497 b/changes/bug40497 new file mode 100644 index 0000000000..d3004d0b72 --- /dev/null +++ b/changes/bug40497 @@ -0,0 +1,8 @@ + o Minor bugfixes (bridges): + - When we don't yet have a descriptor for one of our bridges, disable + the entry guard retry schedule on that bridge. The entry guard retry + schedule and the bridge descriptor retry schedule can conflict, + e.g. where we mark a bridge as "maybe up" yet we don't try to fetch + its descriptor yet, leading Tor to wait (refusing to do anything) + until it becomes time to fetch the descriptor. Fixes bug 40497; + bugfix on 0.3.0.3-alpha. diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c index a05ec63512..32ecb4f705 100644 --- a/src/feature/client/entrynodes.c +++ b/src/feature/client/entrynodes.c @@ -2059,6 +2059,14 @@ entry_guard_consider_retry(entry_guard_t *guard) get_retry_schedule(guard->failing_since, now, guard->is_primary); const time_t last_attempt = guard->last_tried_to_connect; + /* Check if it is a bridge and we don't have its descriptor yet */ + if (guard->bridge_addr && !guard_has_descriptor(guard)) { + /* We want to leave the retry schedule to fetch_bridge_descriptors(), + * so we don't have two retry schedules clobbering each other. See + * bugs 40396 and 40497 for details of why we need this exception. */ + return; + } + if (BUG(last_attempt == 0) || now >= last_attempt + delay) { /* We should mark this retriable. */ |