]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix for bug 7112 (spewing complaints from tor_addr_is_internal)
authorNick Mathewson <nickm@torproject.org>
Wed, 17 Oct 2012 15:15:01 +0000 (11:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 17 Oct 2012 15:15:01 +0000 (11:15 -0400)
In 4768c0efe3e9471cc367c3740d1a4ba0ab79626c (not in any released
version of Tor), we removed a little block of code that set the addr
field of an exit connection used in making a tunneled directory
request.  Turns out that wasn't right.

src/or/connection_edge.c

index e7bc09a19768ec7ad34757564a4aecce48dd6405..53b57ebffec7d79ecc360c6098090e78a2d332d9 100644 (file)
@@ -3180,7 +3180,12 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
   n_stream->on_circuit = circ;
 
   if (rh.command == RELAY_COMMAND_BEGIN_DIR) {
+    tor_addr_t tmp_addr;
     tor_assert(or_circ);
+    if (or_circ->p_chan &&
+        channel_get_addr_if_possible(or_circ->p_chan, &tmp_addr)) {
+      tor_addr_copy(&n_stream->base_.addr, &tmp_addr);
+    }
     return connection_exit_connect_dir(n_stream);
   }