]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
relay: Don't BUG() if we can't find authority descriptor
authorDavid Goulet <dgoulet@torproject.org>
Thu, 14 Jan 2021 14:56:11 +0000 (09:56 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 14 Jan 2021 15:02:03 +0000 (10:02 -0500)
We can end up trying to find our address from an authority while we don't have
yet its descriptor.

In this case, don't BUG() and just come back later.

Closes #40231

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40231 [new file with mode: 0644]
src/feature/relay/relay_find_addr.c

diff --git a/changes/ticket40231 b/changes/ticket40231
new file mode 100644 (file)
index 0000000..a5ba598
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (relay):
+    - If we were unable to build our descriptor, don't mark that we've
+      advertised our descriptor. Also remove an harmless BUG(). Fixes bug 40231;
+      bugfix on 0.4.5.1-alpha.
index 9c2c8b281cd6ff8a70a38caa2f218544129c6ace..2da2328b1496372e90c9fd86210fdf2155eb395f 100644 (file)
@@ -198,9 +198,13 @@ relay_addr_learn_from_dirauth(void)
       return;
     }
     const node_t *node = node_get_by_id(rs->identity_digest);
-    if (BUG(!node)) {
-      /* If there is a routerstatus_t, there is a node_t thus this should
-       * never fail. */
+    if (!node) {
+      /* This can happen if we are still in the early starting stage where no
+       * descriptors we actually fetched and thus we have the routerstatus_t
+       * for the authority but not its descriptor which is needed to build a
+       * circuit and thus learn our address. */
+      log_info(LD_GENERAL, "Can't build a circuit to an authority. Unable to "
+                           "learn for now our address from them.");
       return;
     }
     extend_info_t *ei = extend_info_from_node(node, 1);