diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-08-05 13:47:07 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-08-05 13:48:58 +0300 |
commit | 74c059596527af67f5df38847e86179852bc7005 (patch) | |
tree | 2613251915a71224ac1f1f2b647e53998c40d19c | |
parent | 1d6054f75065214c55d17796cf1587692fbb5cea (diff) | |
download | tor-74c059596527af67f5df38847e86179852bc7005.tar.gz tor-74c059596527af67f5df38847e86179852bc7005.zip |
Ignore regular cells in padding circuits.
Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells from
their past life, but they have no way or reason to answer them anymore. Hence
let's ignore them before they even get to the proper subsystems.
-rw-r--r-- | changes/bug30942 | 4 | ||||
-rw-r--r-- | src/core/or/relay.c | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/changes/bug30942 b/changes/bug30942 new file mode 100644 index 0000000000..bd6b2ff581 --- /dev/null +++ b/changes/bug30942 @@ -0,0 +1,4 @@ + o Minor bugfixes (circuit padding): + - Ignore non-padding cells on padding circuits. This addresses various + warning messages from subsystems that were not expecting padding + circuits. Fixes bug 30942; bugfix on 0.4.1.1-alpha.
\ No newline at end of file diff --git a/src/core/or/relay.c b/src/core/or/relay.c index 9f90a09699..9e691a02b5 100644 --- a/src/core/or/relay.c +++ b/src/core/or/relay.c @@ -1663,6 +1663,17 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, if (circpad_handle_padding_negotiated(circ, cell, layer_hint) == 0) circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); return 0; + } + + /* If this is a padding circuit we don't need to parse any other commands + * than the padding ones. Just drop them to the floor. */ + if (circ->purpose == CIRCUIT_PURPOSE_C_CIRCUIT_PADDING) { + log_info(domain, "Ignored cell (%d) that arrived in padding circuit.", + rh.command); + return 0; + } + + switch (rh.command) { case RELAY_COMMAND_BEGIN: case RELAY_COMMAND_BEGIN_DIR: if (layer_hint && |