[or-cvs] r18423: {tor} uh, and commit the patch too. (tor/trunk/src/or)

arma at seul.org arma at seul.org
Mon Feb 9 03:13:14 UTC 2009


Author: arma
Date: 2009-02-08 22:13:14 -0500 (Sun, 08 Feb 2009)
New Revision: 18423

Modified:
   tor/trunk/src/or/routerparse.c
Log:
uh, and commit the patch too.


Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2009-02-09 03:13:05 UTC (rev 18422)
+++ tor/trunk/src/or/routerparse.c	2009-02-09 03:13:14 UTC (rev 18423)
@@ -1643,12 +1643,19 @@
 
   tok = find_opt_by_keyword(tokens, K_DIR_ADDRESS);
   if (tok) {
+    struct in_addr in;
+    char *address = NULL;
     tor_assert(tok->n_args);
-    if (parse_addr_port(LOG_WARN, tok->args[0], NULL, &cert->addr,
-                        &cert->dir_port)<0) {
+    /* XXX021 use tor_addr_port_parse() below instead. -RD */
+    if (parse_addr_port(LOG_WARN, tok->args[0], &address, NULL,
+                        &cert->dir_port)<0 ||
+        tor_inet_aton(address, &in) == 0) {
       log_warn(LD_DIR, "Couldn't parse dir-address in certificate");
+      tor_free(address);
       goto err;
     }
+    cert->addr = ntohl(in.s_addr);
+    tor_free(address);
   }
 
   tok = find_by_keyword(tokens, K_DIR_KEY_PUBLISHED);



More information about the tor-commits mailing list