tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit e7da6810346c0e141d67e67db8ff4a1bdaedf67f
parent 43b388057884801fc20d869ee6d4f2e314907d02
Author: David Goulet <dgoulet@torproject.org>
Date:   Mon, 21 Dec 2020 14:55:44 -0500

Merge branch 'maint-0.4.5'

Diffstat:
Achanges/ticket40201 | 3+++
Msrc/app/config/resolve_addr.c | 12++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/changes/ticket40201 b/changes/ticket40201 @@ -0,0 +1,3 @@ + o Minor bugfixes (logging, relay): + - Logs the address discovered by the directory authorities if none were + configured or detected before. Fixes bug 40201; bugfix on 0.4.5.1-alpha. diff --git a/src/app/config/resolve_addr.c b/src/app/config/resolve_addr.c @@ -130,8 +130,16 @@ resolved_addr_set_suggested(const tor_addr_t *addr) tor_addr_family(addr) != AF_INET6)) { return; } - tor_addr_copy(&last_suggested_addrs[af_to_idx(tor_addr_family(addr))], - addr); + + /* In case we don't have a configured address, log that we will be using the + * one discovered from the dirauth. */ + const int idx = af_to_idx(tor_addr_family(addr)); + if (tor_addr_is_null(&last_resolved_addrs[idx]) && + !tor_addr_eq(&last_suggested_addrs[idx], addr)) { + log_notice(LD_CONFIG, "External address seen and suggested by a " + "directory authority: %s", fmt_addr(addr)); + } + tor_addr_copy(&last_suggested_addrs[idx], addr); } /** Copy the last resolved address of family into addr_out.