From c0b1f05fe717ab30dc344c8ea3c32022725dcf2c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 28 Feb 2013 17:20:46 -0500 Subject: [PATCH 1/2] Fix bootstrapping with bridges by making is_dir_cache is set on them. This fixes bug 8367, introduced in d7089ff228227259137b5a8b. Not in any released Tor. --- src/or/entrynodes.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index 51c3a56742..e89eabce35 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -133,6 +133,8 @@ entry_guard_set_status(entry_guard_t *e, const node_t *node, if (node) { int is_dir = node_is_dir(node) && node->rs && node->rs->version_supports_microdesc_cache; + if (options->UseBridges && node_is_a_configured_bridge(node)) + is_dir = 1; if (e->is_dir_cache != is_dir) { e->is_dir_cache = is_dir; changed = 1; @@ -354,6 +356,8 @@ add_an_entry_guard(const node_t *chosen, int reset_status, int prepend, } entry->is_dir_cache = node->rs && node->rs->version_supports_microdesc_cache; + if (get_options()->UseBridges && node_is_a_configured_bridge(node)) + entry->is_dir_cache = 1; return NULL; } } else if (!for_directory) { From 8b26766a6672f71a83c13dec18abd62658f6a6fc Mon Sep 17 00:00:00 2001 From: Andrea Shepard Date: Fri, 1 Mar 2013 01:59:25 -0800 Subject: [PATCH 2/2] Correctly set entry->is_dir_cache when adding an entry guard for the first time (Second part of a bug8367 fix. -NM) --- src/or/entrynodes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index e89eabce35..5d356b6231 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -381,6 +381,8 @@ add_an_entry_guard(const node_t *chosen, int reset_status, int prepend, memcpy(entry->identity, node->identity, DIGEST_LEN); entry->is_dir_cache = node_is_dir(node) && node->rs && node->rs->version_supports_microdesc_cache; + if (get_options()->UseBridges && node_is_a_configured_bridge(node)) + entry->is_dir_cache = 1; /* Choose expiry time smudged over the past month. The goal here * is to a) spread out when Tor clients rotate their guards, so they