diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-08-05 20:08:19 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-08-05 20:08:19 +0000 |
commit | 960a0f0a994ba23480e14ffe5179160194fd9616 (patch) | |
tree | 250494775699fda2f0f543a350b02e89c5a77a03 /src/or/routerparse.c | |
parent | 750bb795ac1fcb5b76b6488690400c77fbff0a3f (diff) | |
download | tor-960a0f0a994ba23480e14ffe5179160194fd9616.tar.gz tor-960a0f0a994ba23480e14ffe5179160194fd9616.zip |
r17641@31-33-44: nickm | 2008-08-05 16:07:53 -0400
Initial conversion of uint32_t addr to tor_addr_t addr in connection_t and related types. Most of the Tor wire formats using these new types are in, but the code to generate and use it is not. This is a big patch. Let me know what it breaks for you.
svn:r16435
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 811e276a73..d86c6f05a9 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -3548,7 +3548,6 @@ rend_decrypt_introduction_points(rend_service_descriptor_t *parsed, directory_token_t *tok; rend_intro_point_t *intro; extend_info_t *info; - struct in_addr ip; int result, num_ok=1; memarea_t *area = NULL; tor_assert(parsed); @@ -3621,12 +3620,17 @@ rend_decrypt_introduction_points(rend_service_descriptor_t *parsed, info->identity_digest, DIGEST_LEN); /* Parse IP address. */ tok = find_first_by_keyword(tokens, R_IPO_IP_ADDRESS); - if (tor_inet_aton(tok->args[0], &ip) == 0) { - log_warn(LD_REND, "Could not parse IP address."); + if (tor_addr_from_str(&info->addr, tok->args[0])<0) { + log_warn(LD_REND, "Could not parse introduction point address."); rend_intro_point_free(intro); goto err; } - info->addr = ntohl(ip.s_addr); + if (tor_addr_family(&info->addr) != AF_INET) { + log_warn(LD_REND, "Introduction point address was not ipv4."); + rend_intro_point_free(intro); + goto err; + } + /* Parse onion port. */ tok = find_first_by_keyword(tokens, R_IPO_ONION_PORT); info->port = (uint16_t) tor_parse_long(tok->args[0],10,1,65535, |