From 2e1f23151c5154b63ad1a533a2d51a1b8ecbd6ad Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 22 Mar 2013 14:57:58 -0400 Subject: count DATA cells with stream ID 0 as delivered for SENDME purposes Found while investigating 8093, but probably not the cause of it, since this bug would result in us sending too few SENDMEs, not in us receiving SENDMEs unexpectedly. Bugfix on the fix for 7889, which has appeared in 0.2.4.10-alpha, but not yet in any released 0.2.3.x version. --- src/or/relay.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/or/relay.c b/src/or/relay.c index a17c33331..f565f9274 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1050,7 +1050,6 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, switch (rh.command) { case RELAY_COMMAND_BEGIN: case RELAY_COMMAND_CONNECTED: - case RELAY_COMMAND_DATA: case RELAY_COMMAND_END: case RELAY_COMMAND_RESOLVE: case RELAY_COMMAND_RESOLVED: @@ -1135,7 +1134,11 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, circuit_consider_sending_sendme(circ, layer_hint); - if (!conn) { + if (rh.stream_id == 0) { + log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Relay data cell with zero " + "stream_id. Dropping."); + return 0; + } else if (!conn) { log_info(domain,"data cell dropped, unknown stream (streamid %d).", rh.stream_id); return 0; -- cgit v1.2.3 From b16321425f477bed0a3220378ff80ac22b805cb1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 4 Jun 2014 12:27:10 -0400 Subject: Bulletproof our 11246 fix a little, based on recommendation from andrea. --- src/or/relay.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/or/relay.c b/src/or/relay.c index f565f9274..628937404 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1074,6 +1074,9 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, * EXIT_CONN_STATE_CONNECTING or EXIT_CONN_STATE_RESOLVING. * This speeds up HTTP, for example. */ optimistic_data = 1; + } else if (rh.stream_id == 0 && rh.command == RELAY_COMMAND_DATA) { + log_warn(LD_BUG, "Somehow I had a connection that matched a " + "data cell with stream ID 0."); } else { return connection_edge_process_relay_cell_not_open( &rh, cell, circ, conn, layer_hint); -- cgit v1.2.3