aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2013-05-31 15:35:51 -0700
committerAndrea Shepard <andrea@torproject.org>2013-05-31 15:35:51 -0700
commitce147a2a9a0e399943362062b1fbccecac36aa99 (patch)
tree494073f29f107f62878cd7623945996805111651 /src/or/control.c
parent30c06c187a0b649bd2d30edc0b16e2376f74ad9a (diff)
downloadtor-ce147a2a9a0e399943362062b1fbccecac36aa99.tar
tor-ce147a2a9a0e399943362062b1fbccecac36aa99.tar.gz
When launching a resolve request on behalf of an AF_UNIX control, omit the address field of the new entry connection. Fixes bug 8639.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 48782682c..88bd00b5e 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -3743,8 +3743,21 @@ control_event_stream_status(entry_connection_t *conn, stream_status_event_t tp,
}
if (tp == STREAM_EVENT_NEW || tp == STREAM_EVENT_NEW_RESOLVE) {
- tor_snprintf(addrport_buf,sizeof(addrport_buf), " SOURCE_ADDR=%s:%d",
- ENTRY_TO_CONN(conn)->address, ENTRY_TO_CONN(conn)->port);
+ /*
+ * When the control conn is an AF_UNIX socket and we have no address,
+ * it gets set to "(Tor_internal)"; see dnsserv_launch_request() in
+ * dnsserv.c.
+ */
+ if (strcmp(ENTRY_TO_CONN(conn)->address, "(Tor_internal)") != 0) {
+ tor_snprintf(addrport_buf,sizeof(addrport_buf), " SOURCE_ADDR=%s:%d",
+ ENTRY_TO_CONN(conn)->address, ENTRY_TO_CONN(conn)->port);
+ } else {
+ /*
+ * else leave it blank so control on AF_UNIX doesn't need to make
+ * something up.
+ */
+ addrport_buf[0] = '\0';
+ }
} else {
addrport_buf[0] = '\0';
}