From 43488472ec120dcf5bd1c5e33009a36e08d2b9e3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 26 Aug 2005 19:25:36 +0000 Subject: [PATCH] The circus music begins playing as nickm and arma juggle an ntohl. Hoop-lah! svn:r4848 --- src/or/routerlist.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 87b5404152..95a2a471fd 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1466,12 +1466,14 @@ add_trusted_dir_server(const char *address, uint16_t port, const char *digest) log_fn(LOG_WARN, "Couldn't find a suitable address. Returning."); return; } - } else if (tor_lookup_hostname(address, &a)) { - log_fn(LOG_WARN, "Unable to lookup address for directory server at %s", - address); - return; + } else { + if (tor_lookup_hostname(address, &a)) { + log_fn(LOG_WARN, "Unable to lookup address for directory server at %s", + address); + return; + } + a = ntohl(a); } - a = ntohl(a); ent = tor_malloc(sizeof(trusted_dir_server_t)); if (address) {