summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-24 02:38:07 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-24 02:38:07 +0000
commit272e64e6746715fc578fb1be5d3a111bf1038d14 (patch)
tree8ff4443c71789229a726fdff5e728be9e187d77a /src/or
parentdf608fef4522d8c9a26e26c10a2ec95b7f74baa4 (diff)
downloadtor-272e64e6746715fc578fb1be5d3a111bf1038d14.tar.gz
tor-272e64e6746715fc578fb1be5d3a111bf1038d14.zip
Use the literal parse of an address in dns_resolve_impl if parsing the address as an ipv4 or ipv6 address _succeeded_. Not if it failed. Bug introduced in r17707 (post 0.2.1.8-alpha), and found by xiando.
svn:r17758
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection_edge.c2
-rw-r--r--src/or/dns.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 9b192b5565..e50f838a98 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2611,7 +2611,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
if (rh.command == RELAY_COMMAND_BEGIN_DIR) {
tor_assert(or_circ);
if (or_circ->p_conn && !tor_addr_is_null(&or_circ->p_conn->_base.addr))
- n_stream->_base.addr = or_circ->p_conn->_base.addr;
+ tor_addr_assign(&n_stream->_base.addr, &or_circ->p_conn->_base.addr);
return connection_exit_connect_dir(n_stream);
}
diff --git a/src/or/dns.c b/src/or/dns.c
index 26cd02d543..fe77a76d7b 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -616,7 +616,7 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
/* first check if exitconn->_base.address is an IP. If so, we already
* know the answer. */
- if (tor_addr_from_str(&addr, exitconn->_base.address)<0) {
+ if (tor_addr_from_str(&addr, exitconn->_base.address) >= 0) {
tor_addr_assign(&exitconn->_base.addr, &addr);
exitconn->address_ttl = DEFAULT_DNS_TTL;
return 1;