]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
resolve scary vanguard-related log msgs on dir auths
authorRoger Dingledine <arma@torproject.org>
Fri, 8 Sep 2023 00:32:57 +0000 (20:32 -0400)
committerRoger Dingledine <arma@torproject.org>
Wed, 26 Mar 2025 15:44:53 +0000 (11:44 -0400)
After we added layer-two vanguards, directory authorities wouldn't
think any of their vanguards were suitable for circuits, leading
to a "Failed to find node for hop #2 of our path. Discarding
this circuit." log message once per second from startup until
they made a fresh consensus. Now they look to their existing
consensus on startup, letting them build circuits properly from
the beginning.

Fixes bug 40802; bugfix on 0.4.7.1-alpha.

changes/bug40802 [new file with mode: 0644]
src/feature/nodelist/nodelist.c

diff --git a/changes/bug40802 b/changes/bug40802
new file mode 100644 (file)
index 0000000..2ec4afd
--- /dev/null
@@ -0,0 +1,9 @@
+  o Minor bugfixes (directory authorities):
+    - After we added layer-two vanguards, directory authorities wouldn't
+      think any of their vanguards were suitable for circuits, leading
+      to a "Failed to find node for hop #2 of our path. Discarding
+      this circuit." log message once per second from startup until
+      they made a fresh consensus. Now they look to their existing
+      consensus on startup, letting them build circuits properly from
+      the beginning. Fixes bug 40802; bugfix on 0.4.7.1-alpha.
+
index 889140b4084bbec85f221f86b087104d104d4d9f..26f78a5bfb78c4a8031533a8db5d7815ff83796d 100644 (file)
@@ -761,15 +761,21 @@ nodelist_set_consensus(const networkstatus_t *ns)
     }
     node_set_country(node);
 
-    /* If we're not an authdir, believe others. */
-    if (!authdir) {
+    /* Set node's flags based on rs's flags. */
+    {
       node->is_valid = rs->is_valid;
       node->is_running = rs->is_flagged_running;
       node->is_fast = rs->is_fast;
       node->is_stable = rs->is_stable;
       node->is_possible_guard = rs->is_possible_guard;
       node->is_exit = rs->is_exit;
-      node->is_bad_exit = rs->is_bad_exit;
+      if (!authdir) {
+        /* Authdirs treat is_bad_exit specially in that they only assign
+         * it when the descriptor arrives. So when a dir auth is reading
+         * the flags from an existing consensus, don't believe the bit
+         * here, else it will get stuck 'on' forever. */
+        node->is_bad_exit = rs->is_bad_exit;
+      }
       node->is_hs_dir = rs->is_hs_dir;
       node->ipv6_preferred = 0;
       if (reachable_addr_prefer_ipv6_orport(options) &&