diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2018-03-13 13:50:35 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-11 15:53:03 -0400 |
commit | ae1aea4cc490658e917b0c08584c7115a57da00b (patch) | |
tree | cef36c74e1204e5a1812289dc61fb9baac17d52c | |
parent | 1d8957129b51826b41f8f9efb7b13c4506222bf5 (diff) | |
download | tor-ae1aea4cc490658e917b0c08584c7115a57da00b.tar.gz tor-ae1aea4cc490658e917b0c08584c7115a57da00b.zip |
Bug 25505: Check circuitmux queues before padding.
-rw-r--r-- | changes/bug25505 | 3 | ||||
-rw-r--r-- | src/or/channelpadding.c | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/changes/bug25505 b/changes/bug25505 new file mode 100644 index 0000000000..101c7d5246 --- /dev/null +++ b/changes/bug25505 @@ -0,0 +1,3 @@ + o Minor bugfixes (netflow padding): + - Ensure circuitmux queues are empty before scheduling or sending padding. + Fixes bug 25505; bugfix on 0.3.1.1-alpha. diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c index 5da3009e67..ba432e716b 100644 --- a/src/or/channelpadding.c +++ b/src/or/channelpadding.c @@ -379,7 +379,8 @@ channelpadding_send_padding_cell_for_callback(channel_t *chan) chan->pending_padding_callback = 0; if (monotime_coarse_is_zero(&chan->next_padding_time) || - chan->has_queued_writes(chan)) { + chan->has_queued_writes(chan) || + (chan->cmux && circuitmux_num_cells(chan->cmux))) { /* We must have been active before the timer fired */ monotime_coarse_zero(&chan->next_padding_time); return; @@ -755,7 +756,11 @@ channelpadding_decide_to_pad_channel(channel_t *chan) return CHANNELPADDING_WONTPAD; } - if (!chan->has_queued_writes(chan)) { + /* There should always be a cmux on the circuit. After that, + * only schedule padding if there are no queued writes and no + * queued cells in circuitmux queues. */ + if (chan->cmux && !chan->has_queued_writes(chan) && + !circuitmux_num_cells(chan->cmux)) { int is_client_channel = 0; if (CHANNEL_IS_CLIENT(chan, options)) { |