aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/selftest.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-07-24 09:11:16 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-07-24 12:18:07 -0400
commitad9806b5390f099a51ca8c8d34eff91e432da3f4 (patch)
tree7c3431dfb7edca4c4ffba46a366e19f6aa802a5f /src/feature/relay/selftest.c
parentfda0fa02bfcf2faef4a973d24877dc7966f6d428 (diff)
downloadtor-ad9806b5390f099a51ca8c8d34eff91e432da3f4.tar.gz
tor-ad9806b5390f099a51ca8c8d34eff91e432da3f4.zip
relay: Publish IPv4 descriptor on guessed IPv6 reachability failure
On an IPv6 reachability failure test, if the address was configured, don't publish the descriptor and log warn. If the address was auto discovered, still publish the descriptor. Closes #33247. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/relay/selftest.c')
-rw-r--r--src/feature/relay/selftest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index d24748b297..13264d4a24 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -398,6 +398,7 @@ router_orport_found_reachable(int family)
{
const routerinfo_t *me = router_get_my_routerinfo();
const or_options_t *options = get_options();
+ const char *reachable_reason = "ORPort found reachable";
bool *can_reach_ptr;
if (family == AF_INET) {
can_reach_ptr = &can_reach_or_port_ipv4;
@@ -422,7 +423,13 @@ router_orport_found_reachable(int family)
ready_to_publish(options) ?
" Publishing server descriptor." : "");
- mark_my_descriptor_dirty("ORPort found reachable");
+ /* Make sure our descriptor is marked to publish the IPv6 if it is now
+ * reachable. This can change at runtime. */
+ if (family == AF_INET6) {
+ mark_my_descriptor_if_omit_ipv6_changes(reachable_reason, false);
+ } else {
+ mark_my_descriptor_dirty(reachable_reason);
+ }
/* This is a significant enough change to upload immediately,
* at least in a test network */
if (options->TestingTorNetwork == 1) {