mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
defense in depth
svn:r6939
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user