diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-25 18:22:43 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-25 18:22:43 +0000 |
commit | ba4969a59e568ae5f54a2cb16722c2f8404e2072 (patch) | |
tree | ceaa7e1cc5ec7d0003b053637c8a125764c8af8d /src/or | |
parent | 527fbc304e1512abd49c1c72d8cda9af78a7299b (diff) | |
download | tor-ba4969a59e568ae5f54a2cb16722c2f8404e2072.tar.gz tor-ba4969a59e568ae5f54a2cb16722c2f8404e2072.zip |
r12959@catbus: nickm | 2007-05-25 14:22:33 -0400
The second time that we resolve a.com and get 1.2.3.4, return an A record mapping (a->1.2.3.4), not mapping (1.2.3.4->1.2.3.4).
svn:r10329
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection_edge.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 5d42548bd8..17ffdd031d 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1180,8 +1180,10 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn, or_options_t *options = get_options(); struct in_addr addr_tmp; int automap = 0; + char orig_address[MAX_SOCKS_ADDR_LEN]; tor_strlower(socks->address); /* normalize it */ + strlcpy(orig_address, socks->address, sizeof(orig_address)); log_debug(LD_APP,"Client asked for %s:%d", safe_str(socks->address), socks->port); @@ -1310,7 +1312,10 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn, return -1; } if (tor_inet_aton(socks->address, &in)) { /* see if it's an IP already */ - answer = in.s_addr; /* leave it in network order */ + /* leave it in network order */ + answer = in.s_addr; + /* remember _what_ is supposed to have been resolved. */ + strlcpy(socks->address, orig_address, sizeof(socks->address)); connection_ap_handshake_socks_resolved(conn,RESOLVED_TYPE_IPV4,4, (char*)&answer,-1); connection_mark_unattached_ap(conn, |