[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #16825 [Tor]: client with explicit EntryNodes, no cached-* files never finds its entrynodes (was: client with explicit guards, no cached-* files stalls forever at Bootstrapped 80%)
#16825: client with explicit EntryNodes, no cached-* files never finds its
entrynodes
--------------------------------+------------------------------------
Reporter: starlight | Owner:
Type: defect | Status: new
Priority: Medium | Milestone: Tor: 0.2.9.x-final
Component: Tor | Version: Tor: 0.2.6.10
Severity: Normal | Resolution:
Keywords: guards, 028-triage | Actual Points:
Parent ID: | Points: medium
Sponsor: SponsorU |
--------------------------------+------------------------------------
Changes (by arma):
* severity: => Normal
Comment:
Confirmed.
You can experience it yourself, with a much simpler torrc than the above.
Delete your cached-* files (I didn't need to mess with my state file),
pick a relay in the current consensus that has the Guard flag and is
around, e.g. Mozilla1, and then run your Tor with
{{{src/or/tor entrynodes Mozilla1}}}
Tor will do all the directory bootstrapping stuff, but it will never make
any 3-hop circuits.
What's supposed to happen: Tor starts up, fetches the consensus, fetches
the authority certificates, and fetches some microdescs. Each receipt of
new dir info calls directory_info_has_arrived(), and the idea is that once
directory_info_has_arrived() decides that router_have_minimum_dir_info(),
then it will call entry_guards_compute_status(), which will call
entry_nodes_should_be_added(), which will set should_add_entry_nodes to 1.
Then the next time we call choose_random_entry_impl() to pick the first
hop of a new circuit, we remember to call entry_guards_set_from_config()
to populate our guard list first.
Except we forgot to call directory_info_has_arrived() for incoming
microdescs! What the heck. I wonder what else is broken here.
Here is a working fix:
{{{
diff --git a/src/or/directory.c b/src/or/directory.c
index 6f8edb5..0242829 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1991,6 +1991,8 @@ connection_dir_client_reached_eof(dir_connection_t
*conn)
}
control_event_bootstrap(BOOTSTRAP_STATUS_LOADING_DESCRIPTORS,
count_loading_descriptors_progress());
+ if (mds && smartlist_len(mds))
+ directory_info_has_arrived(now, 0);
SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
smartlist_free(which);
smartlist_free(mds);
}}}
(Probably we want to put that control_event_bootstrap inside the "if mds"
clause too, but I didn't want to go overboard on the patch quite yet.)
One downside of this patch is that bootstrapping gets noisier, since it
reconsiders whether it needs to do things each time it learns new
microdescs -- which is the point of the function after all.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16825#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs