tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 89cac03ea7272a0a6266bdc2951de5d2d8dc3191
parent d8a4558532aa8157a52c88f7f2b468fa9d41e43e
Author: David Goulet <dgoulet@torproject.org>
Date:   Wed, 12 Nov 2025 15:04:51 -0500

conflux: Remove BUG() on a protocol level issue

This BUG() can be triggered and it can lead to a large amount of logs so avoid
this as we don't need it.

Signed-off-by: David Goulet <dgoulet@torproject.org>

Diffstat:
Msrc/core/or/conflux.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/core/or/conflux.c b/src/core/or/conflux.c @@ -879,9 +879,11 @@ conflux_process_cell(conflux_t *cfx, circuit_t *in_circ, * now be checked for remaining elements */ cfx->last_seq_delivered++; return true; - } else if (BUG(leg->last_seq_recv <= cfx->last_seq_delivered)) { - log_warn(LD_BUG, "Got a conflux cell with a sequence number " - "less than the last delivered. Closing circuit."); + } else if (leg->last_seq_recv <= cfx->last_seq_delivered) { + /* Anyone can mangle these sequence number. */ + log_fn(LOG_PROTOCOL_WARN, LD_BUG, + "Got a conflux cell with a sequence number " + "less than the last delivered. Closing circuit."); circuit_mark_for_close(in_circ, END_CIRC_REASON_INTERNAL); return false; } else {