]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/sctp/outqueue.c
sctp: use read_lock_bh in sctp_eps_seq_show
[karo-tx-linux.git] / net / sctp / outqueue.c
index 8081476ed313cca8ad8f9876ec5ef5dc8fd68207..20299df163b98ededf0d8f87ccdeb8d08ca648f0 100644 (file)
@@ -353,6 +353,8 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
        struct sctp_chunk *chk, *temp;
 
        list_for_each_entry_safe(chk, temp, queue, transmitted_list) {
+               struct sctp_stream_out *streamout;
+
                if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
                    chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
                        continue;
@@ -361,8 +363,10 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
                sctp_insert_list(&asoc->outqueue.abandoned,
                                 &chk->transmitted_list);
 
+               streamout = &asoc->stream.out[chk->sinfo.sinfo_stream];
                asoc->sent_cnt_removable--;
                asoc->abandoned_sent[SCTP_PR_INDEX(PRIO)]++;
+               streamout->abandoned_sent[SCTP_PR_INDEX(PRIO)]++;
 
                if (!chk->tsn_gap_acked) {
                        if (chk->transport)
@@ -396,6 +400,12 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
                q->out_qlen -= chk->skb->len;
                asoc->sent_cnt_removable--;
                asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
+               if (chk->sinfo.sinfo_stream < asoc->stream.outcnt) {
+                       struct sctp_stream_out *streamout =
+                               &asoc->stream.out[chk->sinfo.sinfo_stream];
+
+                       streamout->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
+               }
 
                msg_len -= SCTP_DATA_SNDSIZE(chk) +
                           sizeof(struct sk_buff) +
@@ -1026,7 +1036,7 @@ static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
                        /* RFC 2960 6.5 Every DATA chunk MUST carry a valid
                         * stream identifier.
                         */
-                       if (chunk->sinfo.sinfo_stream >= asoc->stream->outcnt) {
+                       if (chunk->sinfo.sinfo_stream >= asoc->stream.outcnt) {
 
                                /* Mark as failed send. */
                                sctp_chunk_fail(chunk, SCTP_ERROR_INV_STRM);
@@ -1044,7 +1054,7 @@ static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
                                continue;
                        }
 
-                       if (asoc->stream->out[sid].state == SCTP_STREAM_CLOSED) {
+                       if (asoc->stream.out[sid].state == SCTP_STREAM_CLOSED) {
                                sctp_outq_head_data(q, chunk);
                                goto sctp_flush_out;
                        }