From: Nick Mathewson Date: Fri, 28 Oct 2011 21:04:15 +0000 (-0400) Subject: Discard all cells on a marked connection X-Git-Tag: tor-0.2.3.7-alpha~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf8bffa35901a26ae840dcd715dd2f664259efb3;p=thirdparty%2Ftor.git Discard all cells on a marked connection Fix for bug 4299 --- diff --git a/changes/bug4299 b/changes/bug4299 new file mode 100644 index 0000000000..c43d81460a --- /dev/null +++ b/changes/bug4299 @@ -0,0 +1,5 @@ + o Major bugfix: + - Do not process cells on a marked-for-close connection. We previously + avoided this by not calling read handlers on marked connections, but + that's not adequate for the case when cells are very small. Fixes + bug 4299; bugfix on 0.2.0.20-rc which first made small cells possible. diff --git a/src/or/command.c b/src/or/command.c index 1fa8bc6a7e..5271a7a907 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -132,6 +132,9 @@ command_process_cell(cell_t *cell, or_connection_t *conn) #define PROCESS_CELL(tp, cl, cn) command_process_ ## tp ## _cell(cl, cn) #endif + if (conn->_base.marked_for_close) + return; + /* Reject all but VERSIONS and NETINFO when handshaking. */ if (handshaking && cell->command != CELL_VERSIONS && cell->command != CELL_NETINFO) @@ -205,6 +208,9 @@ command_process_var_cell(var_cell_t *cell, or_connection_t *conn) } #endif + if (conn->_base.marked_for_close) + return; + /* reject all when not handshaking. */ if (conn->_base.state != OR_CONN_STATE_OR_HANDSHAKING) return;