]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a missing ntohl to tell_controller_about_resolve_result
authorNick Mathewson <nickm@torproject.org>
Tue, 1 May 2012 20:39:49 +0000 (16:39 -0400)
committerRoger Dingledine <arma@torproject.org>
Tue, 1 May 2012 21:21:47 +0000 (17:21 -0400)
Fix for bug 5723; bugfix on 0.2.3.1-alpha (commit 22f723e4)

changes/bug5723 [new file with mode: 0644]
src/or/connection_edge.c

diff --git a/changes/bug5723 b/changes/bug5723
new file mode 100644 (file)
index 0000000..7f0dcb8
--- /dev/null
@@ -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.
index 03558e557c908936ff05e2b9174c320c6cd3a234..5ef56a63b025cc13c26849920885caf6abf9402b 100644 (file)
@@ -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);