aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-08 15:54:30 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-19 02:02:17 -0400
commit8314fa5e5c8d300323589ff97599f8f93b847b78 (patch)
tree0d7f0a8e020731f090bbb64ef64b5938bde1b3ce /src/or/directory.c
parent424063e3b2b882d72943bda41279bd29a711ec55 (diff)
downloadtor-8314fa5e5c8d300323589ff97599f8f93b847b78.tar.gz
tor-8314fa5e5c8d300323589ff97599f8f93b847b78.zip
Implement sensible isolation for tunneled directory conns
One-hop dirconn streams all share a session group, and get the ISO_SESSIONGRP flag: they may share circuits with each other and nothing else. Anonymized dirconn streams get a new internal-use-only ISO_STREAM flag: they may not share circuits with anything, including each other.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 2667f1212f..744bc120fb 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -973,6 +973,10 @@ directory_initiate_command_rend(const char *address, const tor_addr_t *_addr,
}
} else { /* we want to connect via a tor connection */
edge_connection_t *linked_conn;
+ /* Anonymized tunneled connections can never share a circuit.
+ * One-hop directory connections can share circuits with each other
+ * but nothing else. */
+ int iso_flags = anonymized_connection ? ISO_STREAM : ISO_SESSIONGRP;
/* If it's an anonymized connection, remember the fact that we
* wanted it for later: maybe we'll want it again soon. */
@@ -988,7 +992,9 @@ directory_initiate_command_rend(const char *address, const tor_addr_t *_addr,
linked_conn =
connection_ap_make_link(TO_CONN(conn),
conn->_base.address, conn->_base.port,
- digest, use_begindir, conn->dirconn_direct);
+ digest,
+ SESSION_GROUP_DIRCONN, iso_flags,
+ use_begindir, conn->dirconn_direct);
if (!linked_conn) {
log_warn(LD_NET,"Making tunnel to dirserver failed.");
connection_mark_for_close(TO_CONN(conn));