diff options
author | David Goulet <dgoulet@torproject.org> | 2020-09-18 13:07:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-11-17 07:58:26 -0500 |
commit | bc5f26ff7006f50acd23f9eb1a99449612b95198 (patch) | |
tree | f6eebcef8fb70c423a83e318371b071baa4396c1 /src/feature/relay/router.c | |
parent | a5538a36037641e49ca05aa3e90fec256794412b (diff) | |
download | tor-bc5f26ff7006f50acd23f9eb1a99449612b95198.tar.gz tor-bc5f26ff7006f50acd23f9eb1a99449612b95198.zip |
relay: Launch dummy circuit only when descriptor build fails
First, this commit moves the launch_dummy_circuit_as_needed() function into
relay_find_addr.c and renames it to relay_addr_learn_from_dirauth(). This is
an attempt to centralize anything relate with address discovery in the right
module.
Second, when building a descriptor and we fail to discover our address,
immediately launch a dummy circuit to an authority in an attempt to learn our
descriptor.
It is still only done every 20 minutes even though the descriptor build is
done every minute. We ought to avoid load on the authority and if we can't
learn in the first place our address from them, chances are more things are
wrong.
Related to #40071
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/relay/router.c')
-rw-r--r-- | src/feature/relay/router.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index 259c38f162..3aa9561f4f 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -2071,7 +2071,9 @@ router_build_fresh_unsigned_routerinfo,(routerinfo_t **ri_out)) /* Tor requires a relay to have an IPv4 so bail if we can't find it. */ if (!have_v4) { - log_warn(LD_CONFIG, "Don't know my address while generating descriptor"); + log_info(LD_CONFIG, "Don't know my address while generating descriptor. " + "Launching circuit to authority to learn it."); + relay_addr_learn_from_dirauth(); result = TOR_ROUTERINFO_ERROR_NO_EXT_ADDR; goto err; } |