From 39d0f69dfee86c4f8703094990d3169fb20614f3 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 23 Feb 2021 09:37:17 -0500 Subject: relay: Avoid a directory early fetch The directory_fetches_from_authorities() is used to know if a client or relay should fetch data from an authority early in the boot process. We had a condition in that function that made a relay trigger that fetch if it didn't know its address (so we can learn it). However, when this is called, the address discovery has not been done yet so it would always return true for a relay. Furthermore, it would always trigger a log notice that the IPv4 couldn't be found which was inevitable because the address discovery process has not been done yet (done when building our first descriptor). It is also important to point out that starting in 0.4.5.1-alpha, asking an authority for an address is done during address discovery time using a one-hop circuit thus independent from the relay deciding to fetch or not documents from an authority. Small fix also is to reverse the "IPv(4|6)Only" flag in the notice so that if we can't find IPv6 it would output to use IPv4Only. Fixes #40300 Signed-off-by: David Goulet --- src/feature/relay/relay_find_addr.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/feature/relay/relay_find_addr.h') diff --git a/src/feature/relay/relay_find_addr.h b/src/feature/relay/relay_find_addr.h index 34890cd34e..f049d1bd20 100644 --- a/src/feature/relay/relay_find_addr.h +++ b/src/feature/relay/relay_find_addr.h @@ -22,8 +22,6 @@ MOCK_DECL(bool, relay_find_addr_to_publish, (const or_options_t *options, int family, int flags, tor_addr_t *addr_out)); -bool relay_has_address_set(int family); - void relay_addr_learn_from_dirauth(void); #ifdef RELAY_FIND_ADDR_PRIVATE -- cgit v1.2.3-54-g00ecf