From 5b3c8865842f3b12d3ea35db19e8feb135bb46dc Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 31 May 2019 11:46:58 -0400 Subject: [PATCH 1/4] Consider dir info to have changed when the bridges change Otherwise, we won't realize that we haven't got enough bridge information to build circuits. Part of a fix for ticket 29875. --- src/app/config/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/config/config.c b/src/app/config/config.c index 2a504d3065..7f6657db3c 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -2412,7 +2412,8 @@ options_act(const or_options_t *old_options) if (!bool_eq(directory_fetches_dir_info_early(options), directory_fetches_dir_info_early(old_options)) || !bool_eq(directory_fetches_dir_info_later(options), - directory_fetches_dir_info_later(old_options))) { + directory_fetches_dir_info_later(old_options)) || + !config_lines_eq(old_options->Bridges, options->Bridges)) { /* Make sure update_router_have_minimum_dir_info() gets called. */ router_dir_info_changed(); /* We might need to download a new consensus status later or sooner than From 8015979eeba2c8b10fb058318628debf228fb023 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 31 May 2019 12:19:29 -0400 Subject: [PATCH 2/4] num_bridges_usable(): only count configured bridges. When this function was implemented, it counted all the entry guards in the bridge set. But this included previously configured bridges, as well as currently configured ones! Instead, only count the _filtered_ bridges (ones that are configured and possibly reachable) as maybe usable. Fixes bug 29875; bugfix on 0.3.0.1-alpha. --- src/feature/client/entrynodes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c index e543289ce0..15ec830594 100644 --- a/src/feature/client/entrynodes.c +++ b/src/feature/client/entrynodes.c @@ -3300,6 +3300,9 @@ num_bridges_usable,(int use_maybe_reachable)) } SMARTLIST_FOREACH_BEGIN(gs->sampled_entry_guards, entry_guard_t *, guard) { + /* Not a bridge, or not one we are configured to be able to use. */ + if (! guard->is_filtered_guard) + continue; /* Definitely not usable */ if (guard->is_reachable == GUARD_REACHABLE_NO) continue; From c09e7a4e715d8266517896cfbc8fc80f19feba85 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 31 May 2019 12:39:52 -0400 Subject: [PATCH 3/4] changes file for bug 29875. --- changes/bug29875 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 changes/bug29875 diff --git a/changes/bug29875 b/changes/bug29875 new file mode 100644 index 0000000000..58a1c871cd --- /dev/null +++ b/changes/bug29875 @@ -0,0 +1,11 @@ + o Major bugfixes (bridges): + - Do not count previously configured working bridges towards our total of + working bridges. Previously, when Tor's list of bridges changed, it + would think that the old bridges were still usable, and delay fetching + router descriptors for the new ones. Fixes part of bug 29875; bugfix + on 0.3.0.1-alpha. + - Consider our directory information to have changed when our list of + bridges changes. Previously, Tor would not re-compute the status of its + directory information when bridges changed, and therefore would not + realize that it was no longer able to build circuits. Fixes part of bug + 29875. From 5e594831c761626022c323e48a8df9cb9deb2291 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 31 May 2019 12:41:44 -0400 Subject: [PATCH 4/4] Practracker excpetions. --- scripts/maint/practracker/exceptions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/maint/practracker/exceptions.txt b/scripts/maint/practracker/exceptions.txt index 3a32e97beb..f0c176560b 100644 --- a/scripts/maint/practracker/exceptions.txt +++ b/scripts/maint/practracker/exceptions.txt @@ -32,7 +32,7 @@ problem file-size /src/app/config/config.c 8520 problem include-count /src/app/config/config.c 88 problem function-size /src/app/config/config.c:options_act_reversible() 296 -problem function-size /src/app/config/config.c:options_act() 588 +problem function-size /src/app/config/config.c:options_act() 590 problem function-size /src/app/config/config.c:resolve_my_address() 192 problem function-size /src/app/config/config.c:options_validate() 1220 problem function-size /src/app/config/config.c:options_init_from_torrc() 210 @@ -136,7 +136,7 @@ problem function-size /src/feature/client/addressmap.c:addressmap_rewrite() 112 problem function-size /src/feature/client/bridges.c:rewrite_node_address_for_bridge() 126 problem function-size /src/feature/client/circpathbias.c:pathbias_measure_close_rate() 108 problem function-size /src/feature/client/dnsserv.c:evdns_server_callback() 153 -problem file-size /src/feature/client/entrynodes.c 3817 +problem file-size /src/feature/client/entrynodes.c 3820 problem function-size /src/feature/client/entrynodes.c:entry_guards_upgrade_waiting_circuits() 153 problem function-size /src/feature/client/entrynodes.c:entry_guard_parse_from_state() 246 problem function-size /src/feature/client/transports.c:handle_proxy_line() 108