diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-11-01 20:27:41 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-11-01 20:27:41 +0000 |
commit | c534b96e585e33044a55d00e8e5633cb8503dee3 (patch) | |
tree | 0ac01dc23e1bb65827fa565a63e5d9eb805a6d94 /src/or/circuitlist.c | |
parent | 0c9dfffe5a19da330f3c2b6daa33c40aa786ba06 (diff) | |
download | tor-c534b96e585e33044a55d00e8e5633cb8503dee3.tar.gz tor-c534b96e585e33044a55d00e8e5633cb8503dee3.zip |
Fix an assertion failure on double-marked circuits, and a double-mark.
svn:r17179
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 9dbec897c9..6d183fb9b1 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1208,13 +1208,21 @@ assert_circuit_ok(const circuit_t *c) if (c->n_conn) { tor_assert(!c->n_hop); - if (c->n_circ_id) - tor_assert(c == circuit_get_by_circid_orconn(c->n_circ_id, c->n_conn)); + if (c->n_circ_id) { + /* We use the _impl variant here to make sure we don't fail on marked + * circuits, which would not be returned by the regular function. */ + circuit_t *c2 = circuit_get_by_circid_orconn_impl(c->n_circ_id, + c->n_conn); + tor_assert(c == c2); + } } if (or_circ && or_circ->p_conn) { - if (or_circ->p_circ_id) - tor_assert(c == circuit_get_by_circid_orconn(or_circ->p_circ_id, - or_circ->p_conn)); + if (or_circ->p_circ_id) { + /* ibid */ + circuit_t *c2 = circuit_get_by_circid_orconn_impl(or_circ->p_circ_id, + or_circ->p_conn); + tor_assert(c == c2); + } } #if 0 /* false now that rendezvous exits are attached to p_streams */ if (origin_circ) |