Selaa lähdekoodia

The circus music begins playing as nickm and arma juggle an ntohl. Hoop-lah!

svn:r4848
Nick Mathewson 20 vuotta sitten
vanhempi
commit
43488472ec
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      src/or/routerlist.c

+ 7 - 5
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) {