diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitlist.c | 7 | ||||
-rw-r--r-- | src/or/command.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 78fcbb3df..0104886d4 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -849,12 +849,13 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int line, reason = END_CIRC_REASON_NONE; } - if (reason & END_CIRC_REASON_FLAG_REMOTE) + if (reason & END_CIRC_REASON_FLAG_REMOTE) { reason &= ~END_CIRC_REASON_FLAG_REMOTE; if (reason < _END_CIRC_REASON_MIN || reason > _END_CIRC_REASON_MAX) { - log_warn(LD_BUG, "Reason %d out of range at %s:%d", reason, file, line); - orig_reason = reason = END_CIRC_REASON_NONE; + if (!(orig_reason & END_CIRC_REASON_FLAG_REMOTE)) + log_warn(LD_BUG, "Reason %d out of range at %s:%d", reason, file, line); + reason = END_CIRC_REASON_NONE; } if (circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) { diff --git a/src/or/command.c b/src/or/command.c index dee38c9ec..b3952efbd 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -374,7 +374,7 @@ command_process_destroy_cell(cell_t *cell, or_connection_t *conn) cell->circ_id == TO_OR_CIRCUIT(circ)->p_circ_id) { /* the destroy came from behind */ circuit_set_p_circid_orconn(TO_OR_CIRCUIT(circ), 0, NULL); - circuit_mark_for_close(circ, reason); + circuit_mark_for_close(circ, reason|END_CIRC_REASON_FLAG_REMOTE); } else { /* the destroy came from ahead */ circuit_set_n_circid_orconn(circ, 0, NULL); if (CIRCUIT_IS_ORIGIN(circ)) { |