aboutsummaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-05-18 15:22:03 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2012-05-18 15:22:03 +0300
commit153b9892f056f2ffa4b1f4a5846ca329d6982805 (patch)
treea6c6e69500ed8bdc85bf1c05ab80674af844b727 /src/or/command.c
parentf00a8b430709aff3045fe20e3f776858e0ec79ae (diff)
downloadtor-153b9892f056f2ffa4b1f4a5846ca329d6982805.tar
tor-153b9892f056f2ffa4b1f4a5846ca329d6982805.tar.gz
Extract data from DESTROY cell _after_ protocol violation checks.
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/command.c b/src/or/command.c
index fb281a7f9..ca3c34103 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -591,7 +591,6 @@ command_process_destroy_cell(cell_t *cell, or_connection_t *conn)
int reason;
circ = circuit_get_by_circid_orconn(cell->circ_id, conn);
- reason = (uint8_t)cell->payload[0];
if (!circ) {
log_info(LD_OR,"unknown circuit %d on connection from %s:%d. Dropping.",
cell->circ_id, conn->_base.address, conn->_base.port);
@@ -599,6 +598,8 @@ command_process_destroy_cell(cell_t *cell, or_connection_t *conn)
}
log_debug(LD_OR,"Received for circID %d.",cell->circ_id);
+ reason = (uint8_t)cell->payload[0];
+
if (!CIRCUIT_IS_ORIGIN(circ) &&
cell->circ_id == TO_OR_CIRCUIT(circ)->p_circ_id) {
/* the destroy came from behind */