From dfcb05e00b5d523d9176c45bfe9ceefcbdd20df5 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 25 Sep 2008 18:21:33 +0000 Subject: [PATCH] DEVEL15-rx-clear-queues-correctly-20080925 LICENSE IPL10 don't potentially leak packets by leaving them behind and initing queues; in fact, if you are cleaning up there is no need to init queues anyway. (cherry picked from commit a72eea6bb1758678d25528cd1ab9b439ade2f844) --- src/rx/rx.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 6e032d307..b4b9083b3 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -1221,7 +1221,7 @@ rx_NewCall(register struct rx_connection *conn) MUTEX_ENTER(&call->lock); rxi_WaitforTQBusy(call); if (call->flags & RX_CALL_TQ_CLEARME) { - rxi_ClearTransmitQueue(call, 0); + rxi_ClearTransmitQueue(call, 1); queue_Init(&call->tq); } MUTEX_EXIT(&call->lock); @@ -2173,7 +2173,7 @@ rxi_NewCall(register struct rx_connection *conn, register int channel) #ifdef AFS_GLOBAL_RXLOCK_KERNEL /* Now, if TQ wasn't cleared earlier, do it now. */ if (call->flags & RX_CALL_TQ_CLEARME) { - rxi_ClearTransmitQueue(call, 0); + rxi_ClearTransmitQueue(call, 1); queue_Init(&call->tq); } #endif /* AFS_GLOBAL_RXLOCK_KERNEL */ @@ -4576,7 +4576,6 @@ rxi_ResetCall(register struct rx_call *call, register int newcall) MUTEX_EXIT(&peer->peer_lock); flags = call->flags; - rxi_ClearReceiveQueue(call); #ifdef AFS_GLOBAL_RXLOCK_KERNEL if (flags & RX_CALL_TQ_BUSY) { call->flags = RX_CALL_TQ_CLEARME | RX_CALL_TQ_BUSY; @@ -4584,8 +4583,8 @@ rxi_ResetCall(register struct rx_call *call, register int newcall) } else #endif /* AFS_GLOBAL_RXLOCK_KERNEL */ { - rxi_ClearTransmitQueue(call, 0); - queue_Init(&call->tq); + rxi_ClearTransmitQueue(call, 1); + /* why init the queue if you just emptied it? queue_Init(&call->tq); */ if (call->tqWaiters || (flags & RX_CALL_TQ_WAIT)) { dpf(("rcall %x has %d waiters and flags %d\n", call, call->tqWaiters, call->flags)); } @@ -4599,7 +4598,9 @@ rxi_ResetCall(register struct rx_call *call, register int newcall) call->tqWaiters--; } } - queue_Init(&call->rq); + + rxi_ClearReceiveQueue(call); + /* why init the queue if you just emptied it? queue_Init(&call->rq); */ call->error = 0; call->twind = call->conn->twind[call->channel]; call->rwind = call->conn->rwind[call->channel]; -- 2.39.5