summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-06-05 09:47:19 +0000
committerRoger Dingledine <arma@torproject.org>2006-06-05 09:47:19 +0000
commita2fec314b674fdb91b41ec253269c64d8681c4e2 (patch)
tree1f9ba1345c8e579d436456b0f55459553197d727 /src/or/circuitbuild.c
parent45065f1466bc5f5eaea0e837938b97808511f143 (diff)
downloadtor-a2fec314b674fdb91b41ec253269c64d8681c4e2.tar.gz
tor-a2fec314b674fdb91b41ec253269c64d8681c4e2.zip
scream louder if you've got a pending circuit for a given
addr/port but the intended n_conn digest is wrong. svn:r6544
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index bac591b16f..5d46342e05 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -418,9 +418,15 @@ circuit_n_conn_done(connection_t *or_conn, int status)
tor_assert(circ->state == CIRCUIT_STATE_OR_WAIT);
if (!circ->n_conn &&
circ->n_addr == or_conn->addr &&
- circ->n_port == or_conn->port &&
- !memcmp(or_conn->identity_digest, circ->n_conn_id_digest,
- DIGEST_LEN)) {
+ circ->n_port == or_conn->port) {
+ if (memcmp(or_conn->identity_digest, circ->n_conn_id_digest,
+ DIGEST_LEN)) {
+ log_fn(LOG_PROTOCOL_WARN, LD_CIRC,
+ "Pending circuit to %s:%d is intended for different digest!",
+ or_conn->address, or_conn->port);
+ circuit_mark_for_close(circ, END_CIRC_REASON_OR_IDENTITY);
+ continue;
+ }
if (!status) { /* or_conn failed; close circ */
log_info(LD_CIRC,"or_conn failed. Closing circ.");
circuit_mark_for_close(circ, END_CIRC_REASON_OR_CONN_CLOSED);