aboutsummaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-07-30 04:32:58 +0000
committerRoger Dingledine <arma@torproject.org>2006-07-30 04:32:58 +0000
commit2bcb081cb1d788b46d5ce86e085549fe5b1d3b81 (patch)
tree922cae7e61679bef19f388ee34c3001872966364 /src/or/command.c
parent7498d31b0981b4c0175dca0f7d3aa5e008725cbd (diff)
downloadtor-2bcb081cb1d788b46d5ce86e085549fe5b1d3b81.tar.gz
tor-2bcb081cb1d788b46d5ce86e085549fe5b1d3b81.zip
defense in depth
svn:r6939
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 9e3e529737..f508ab2545 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -173,6 +173,16 @@ command_process_create_cell(cell_t *cell, or_connection_t *conn)
return;
}
+ if (!server_mode(get_options())) {
+ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+ "Received create cell (type %d) from %s:%d, but we're a client. "
+ "Sending back a destroy.",
+ (int)cell->command, conn->_base.address, conn->_base.port);
+ connection_or_send_destroy(cell->circ_id, conn,
+ END_CIRC_REASON_TORPROTOCOL);
+ return;
+ }
+
/* If the high bit of the circuit ID is not as expected, close the
* circ. */
id_is_high = cell->circ_id & (1<<15);