tor

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

commit 2d0a6d76916d61e6264d8537e0d99daeae9829ba
parent 7852499812a4bbe707ff0da065a853de69be2c4d
Author: Nick Mathewson <nickm@torproject.org>
Date:   Tue, 11 Sep 2018 14:32:39 -0400

Merge remote-tracking branch 'mikeperry/bug25505'

Diffstat:
Achanges/bug25505 | 3+++
Msrc/core/or/channelpadding.c | 9+++++++--
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug25505 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/core/or/channelpadding.c b/src/core/or/channelpadding.c @@ -376,7 +376,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; @@ -743,7 +744,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)) {