aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 8f1994760..90b707bcd 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3951,12 +3951,14 @@ trusted_dir_server_new(const char *nickname, const char *address,
dir_server_t *result;
if (!address) { /* The address is us; we should guess. */
- if (resolve_my_address(LOG_WARN, get_options(), &a, &hostname) < 0) {
+ if (resolve_my_address(LOG_WARN, get_options(), &a, NULL, &hostname) < 0) {
log_warn(LD_CONFIG,
"Couldn't find a suitable address when adding ourself as a "
"trusted directory server.");
return NULL;
}
+ if (!hostname)
+ hostname = tor_dup_ip(a);
} else {
if (tor_lookup_hostname(address, &a)) {
log_warn(LD_CONFIG,