commit dd7c86b242cdb7e056d632286718d7574b13de57
parent 7de500d85baf2279b9777a07fbe205bcf13fb47c
Author: Roger Dingledine <arma@torproject.org>
Date: Sat, 4 Oct 2025 12:08:51 -0400
refactor router_dirport_seems_reachable() out
Diffstat:
4 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/feature/control/control_getinfo.c b/src/feature/control/control_getinfo.c
@@ -1257,14 +1257,12 @@ getinfo_helper_events(control_connection_t *control_conn,
router_all_orports_seem_reachable(options) ?
"1" : "0");
} else if (!strcmp(question, "status/reachability-succeeded/dir")) {
- *answer = tor_strdup(
- router_dirport_seems_reachable(options) ?
- "1" : "0");
+ *answer = tor_strdup("1"); /* obsolete since tor#2667) */
} else if (!strcmp(question, "status/reachability-succeeded")) {
tor_asprintf(
answer, "OR=%d DIR=%d",
router_all_orports_seem_reachable(options) ? 1 : 0,
- router_dirport_seems_reachable(options) ? 1 : 0);
+ 1);
} else if (!strcmp(question, "status/bootstrap-phase")) {
*answer = control_event_boot_last_msg();
} else if (!strcmpstart(question, "status/version/")) {
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
@@ -1466,7 +1466,7 @@ decide_if_publishable_server(void)
return 0;
}
}
- return router_dirport_seems_reachable(options);
+ return 1; /* everything looks good! publish. */
}
/** Initiate server descriptor upload as reasonable (if server is publishable,
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
@@ -130,16 +130,6 @@ router_orport_seems_reachable(const or_options_t *options,
return true;
}
-/** Relay DirPorts are no longer used (though authorities are). In either case,
- * reachability self test is done anymore, since network re-entry towards an
- * authority DirPort is not allowed. Thus, consider it always reachable. */
-int
-router_dirport_seems_reachable(const or_options_t *options)
-{
- (void) options;
- return 1;
-}
-
/** See if we currently believe our ORPort to be unreachable. If so, return 1
* else return 0. */
static int
diff --git a/src/feature/relay/selftest.h b/src/feature/relay/selftest.h
@@ -20,8 +20,6 @@ struct or_options_t;
int router_orport_seems_reachable(
const struct or_options_t *options,
int family);
-int router_dirport_seems_reachable(
- const struct or_options_t *options);
void router_do_reachability_checks(void);
void router_perform_bandwidth_test(int num_circs, time_t now);