Skip to content
Snippets Groups Projects
Commit e3f6f92c authored by Nick Mathewson's avatar Nick Mathewson :family:
Browse files

check for duplicate circuit ID _after_ updating circ_id_type.

svn:r3058
parent 6e9a91c3
No related branches found
No related tags found
No related merge requests found
......@@ -137,13 +137,6 @@ static void command_process_create_cell(cell_t *cell, connection_t *conn) {
return;
}
circ = circuit_get_by_circ_id_conn(cell->circ_id, conn);
if (circ) {
log_fn(LOG_WARN,"received CREATE cell (circID %d) for known circ. Dropping.", cell->circ_id);
return;
}
/* If the high bit of the circuit ID is not as expected, then switch
* which half of the space we'll use for our own CREATE cells.
*
......@@ -160,6 +153,13 @@ static void command_process_create_cell(cell_t *cell, connection_t *conn) {
conn->circ_id_type = CIRC_ID_TYPE_HIGHER;
}
circ = circuit_get_by_circ_id_conn(cell->circ_id, conn);
if (circ) {
log_fn(LOG_WARN,"received CREATE cell (circID %d) for known circ. Dropping.", cell->circ_id);
return;
}
circ = circuit_new(cell->circ_id, conn);
circ->state = CIRCUIT_STATE_ONIONSKIN_PENDING;
circ->purpose = CIRCUIT_PURPOSE_OR;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment