summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-12-01 04:55:03 +0000
committerNick Mathewson <nickm@torproject.org>2004-12-01 04:55:03 +0000
commite3f6f92cf7d3a2fedc387ed1084aa82815c911dd (patch)
tree064edce0c89e10e8262dbd9ed94f441b28720474
parent6e9a91c382e9ae74f4f687f00e533df7b545e5f6 (diff)
downloadtor-e3f6f92cf7d3a2fedc387ed1084aa82815c911dd.tar.gz
tor-e3f6f92cf7d3a2fedc387ed1084aa82815c911dd.zip
check for duplicate circuit ID _after_ updating circ_id_type.tor-0.0.9rc5
svn:r3058
-rw-r--r--src/or/command.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 0e1e6f207f..1bf5d9ef0c 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -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;