aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-06-10 13:35:45 -0400
committerNick Mathewson <nickm@torproject.org>2014-06-14 11:00:44 -0400
commit8f3e3279c198dd13c11ffd739ddf08dbe8b07762 (patch)
treecb013d3fe1b324718adc9a8ec75fc920c83fca07 /src/or/relay.c
parent173a1afc5819f1fcabfa34bab5714d61088cc29f (diff)
downloadtor-8f3e3279c198dd13c11ffd739ddf08dbe8b07762.tar
tor-8f3e3279c198dd13c11ffd739ddf08dbe8b07762.tar.gz
Try to diagnose bug 12184
Check for consistency between the queued destroy cells and the marked circuit IDs. Check for consistency in the count of queued destroy cells in several ways. Check to see whether any of the marked circuit IDs have somehow been marked longer than the channel has existed.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 509d7ced0..58d6db2b2 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2563,6 +2563,17 @@ packed_cell_get_command(const packed_cell_t *cell, int wide_circ_ids)
}
}
+/** Extract the circuit ID from a packed cell. */
+circid_t
+packed_cell_get_circid(const packed_cell_t *cell, int wide_circ_ids)
+{
+ if (wide_circ_ids) {
+ return ntohl(get_uint32(cell->body));
+ } else {
+ return ntohs(get_uint16(cell->body));
+ }
+}
+
/** Pull as many cells as possible (but no more than <b>max</b>) from the
* queue of the first active circuit on <b>chan</b>, and write them to
* <b>chan</b>-&gt;outbuf. Return the number of cells written. Advance