From c9afd6f9c5a3cf73340e528818570b4ba5cdf6b2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 1 May 2012 16:39:49 -0400 Subject: [PATCH] Add a missing ntohl to tell_controller_about_resolve_result Fix for bug 5723; bugfix on 0.2.3.1-alpha (commit 22f723e4) --- changes/bug5723 | 4 ++++ src/or/connection_edge.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes/bug5723 diff --git a/changes/bug5723 b/changes/bug5723 new file mode 100644 index 0000000000..7f0dcb8293 --- /dev/null +++ b/changes/bug5723 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - Format IPv4 addresses correctly in ADDRMAP events. (Previously, + we had reversed them when the answer was cached.) Fixes bug + 5723; bugfix on 0.2.3.1-alpha. diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 03558e557c..5ef56a63b0 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2745,7 +2745,7 @@ tell_controller_about_resolved_result(entry_connection_t *conn, answer_type == RESOLVED_TYPE_HOSTNAME)) { return; /* we already told the controller. */ } else if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) { - char *cp = tor_dup_ip(get_uint32(answer)); + char *cp = tor_dup_ip(ntohl(get_uint32(answer))); control_event_address_mapped(conn->socks_request->address, cp, expires, NULL); tor_free(cp); -- 2.11.4.GIT