summaryrefslogtreecommitdiff
path: root/src/feature/relay/selftest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature/relay/selftest.c')
-rw-r--r--src/feature/relay/selftest.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index 64b8578bac..ae24a04401 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -86,9 +86,8 @@ router_reachability_checks_disabled(const or_options_t *options)
* orport checks.
*/
int
-router_orport_seems_reachable(
- const or_options_t *options,
- int family)
+router_orport_seems_reachable(const or_options_t *options,
+ int family)
{
tor_assert_nonfatal(family == AF_INET || family == AF_INET6 || family == 0);
int reach_checks_disabled = router_reachability_checks_disabled(options);
@@ -96,6 +95,11 @@ router_orport_seems_reachable(
return true;
}
+ // Note that we do a == 1 here, not just a boolean check. This value
+ // is also an autobool, so CFG_AUTO does not mean that we should
+ // assume IPv6 ports are reachable.
+ const bool ipv6_assume_reachable = (options->AssumeReachableIPv6 == 1);
+
// Which reachability flags should we look at?
const bool checking_ipv4 = (family == AF_INET || family == 0);
const bool checking_ipv6 = (family == AF_INET6 || family == 0);
@@ -105,7 +109,7 @@ router_orport_seems_reachable(
return false;
}
}
- if (checking_ipv6) {
+ if (checking_ipv6 && !ipv6_assume_reachable) {
if (have_orport_for_family(AF_INET6) && !can_reach_or_port_ipv6) {
return false;
}