summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-01-14 09:56:11 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-01-14 10:02:03 -0500
commitf0c29f0883045283d86b584f1634770358d84f41 (patch)
treed82d5d0d0f03841241f649e7b572120b439c536e /src
parent743a5ef2b3781b593f5299758d0a7fc78b5816c4 (diff)
downloadtor-f0c29f0883045283d86b584f1634770358d84f41.tar.gz
tor-f0c29f0883045283d86b584f1634770358d84f41.zip
relay: Don't BUG() if we can't find authority descriptor
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>
Diffstat (limited to 'src')
-rw-r--r--src/feature/relay/relay_find_addr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/feature/relay/relay_find_addr.c b/src/feature/relay/relay_find_addr.c
index 9c2c8b281c..2da2328b14 100644
--- a/src/feature/relay/relay_find_addr.c
+++ b/src/feature/relay/relay_find_addr.c
@@ -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);