Skip to content

Commit 9ed8f0f

Browse files
lxingregkh
authored andcommitted
sctp: out_qlen should be updated when pruning unsent queue
[ Upstream commit 23bb09c ] This patch is to fix the issue that sctp_prsctp_prune_sent forgot to update q->out_qlen when removing a chunk from unsent queue. Fixes: 8dbdf1f ("sctp: implement prsctp PRIO policy") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b4cf187 commit 9ed8f0f

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

net/sctp/outqueue.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,17 +382,18 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
382382
}
383383

384384
static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
385-
struct sctp_sndrcvinfo *sinfo,
386-
struct list_head *queue, int msg_len)
385+
struct sctp_sndrcvinfo *sinfo, int msg_len)
387386
{
387+
struct sctp_outq *q = &asoc->outqueue;
388388
struct sctp_chunk *chk, *temp;
389389

390-
list_for_each_entry_safe(chk, temp, queue, list) {
390+
list_for_each_entry_safe(chk, temp, &q->out_chunk_list, list) {
391391
if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
392392
chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
393393
continue;
394394

395395
list_del_init(&chk->list);
396+
q->out_qlen -= chk->skb->len;
396397
asoc->sent_cnt_removable--;
397398
asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
398399

@@ -431,9 +432,7 @@ void sctp_prsctp_prune(struct sctp_association *asoc,
431432
return;
432433
}
433434

434-
sctp_prsctp_prune_unsent(asoc, sinfo,
435-
&asoc->outqueue.out_chunk_list,
436-
msg_len);
435+
sctp_prsctp_prune_unsent(asoc, sinfo, msg_len);
437436
}
438437

439438
/* Mark all the eligible packets on a transport for retransmission. */

0 commit comments

Comments
 (0)