defense in depth

svn:r6939
This commit is contained in:
Roger Dingledine
2006-07-30 04:32:58 +00:00
parent 7498d31b09
commit 2bcb081cb1
3 changed files with 26 additions and 2 deletions
+10
View File
@@ -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);