don't try a dir fetch from a descriptorless bridge

When choosing a bridge to fetch directory info from, only select
from among bridges whose descriptors we already have. In theory we
don't need the bridge's descriptor to ask it for directory info,
but in practice the code that does the fetching assumes we do.

This mistake only slows down bootstrap, but shouldn't prevent it.

Fixes bug 40746; bugfix on 0.3.0.3-alpha. (Specifically, commit 02da24f8e5.)
This commit is contained in:
Roger Dingledine 2023-02-01 14:17:08 -05:00
parent 96521e8188
commit 7c629854a0
2 changed files with 11 additions and 2 deletions

7
changes/bug40746 Normal file
View File

@ -0,0 +1,7 @@
o Minor bugfixes (bridge users):
- When choosing a bridge to fetch directory info from, only select
from among bridges whose descriptors we already have. In theory we
don't need the bridge's descriptor to ask it for directory info,
but in practice the code that does the fetching assumes we do. This
mistake only slows down bootstrap, but shouldn't prevent it. Fixes
bug 40746; bugfix on 0.3.0.3-alpha.

View File

@ -2105,7 +2105,8 @@ select_primary_guard_for_circuit(guard_selection_t *gs,
const entry_guard_restriction_t *rst,
unsigned *state_out)
{
const int need_descriptor = (usage == GUARD_USAGE_TRAFFIC);
const int need_descriptor = (usage == GUARD_USAGE_TRAFFIC) ||
get_options()->UseBridges;
entry_guard_t *chosen_guard = NULL;
int num_entry_guards = get_n_primary_guards_to_use(usage);
@ -2157,7 +2158,8 @@ select_confirmed_guard_for_circuit(guard_selection_t *gs,
const entry_guard_restriction_t *rst,
unsigned *state_out)
{
const int need_descriptor = (usage == GUARD_USAGE_TRAFFIC);
const int need_descriptor = (usage == GUARD_USAGE_TRAFFIC) ||
get_options()->UseBridges;
SMARTLIST_FOREACH_BEGIN(gs->confirmed_entry_guards, entry_guard_t *, guard) {
if (guard->is_primary)