Author: tuexen
Date: Fri Nov 27 22:11:46 2015
New Revision: 291410
URL: https://svnweb.freebsd.org/changeset/base/291410

Log:
  Take also the send queue and sent queue into account when triggering
  the sending of outgoing stream reset requests.
  
  MFC after:    3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c      Fri Nov 27 21:27:39 2015        
(r291409)
+++ head/sys/netinet/sctp_output.c      Fri Nov 27 22:11:46 2015        
(r291410)
@@ -7169,7 +7169,8 @@ one_more_time:
                        }
                        atomic_subtract_int(&asoc->stream_queue_cnt, 1);
                        TAILQ_REMOVE(&strq->outqueue, sp, next);
-                       if (strq->state == SCTP_STREAM_RESET_PENDING &&
+                       if ((strq->state == SCTP_STREAM_RESET_PENDING) &&
+                           (strq->chunks_on_queues == 0) &&
                            TAILQ_EMPTY(&strq->outqueue)) {
                                stcb->asoc.trigger_reset = 1;
                        }
@@ -7571,7 +7572,8 @@ dont_do_it:
                        send_lock_up = 1;
                }
                TAILQ_REMOVE(&strq->outqueue, sp, next);
-               if (strq->state == SCTP_STREAM_RESET_PENDING &&
+               if ((strq->state == SCTP_STREAM_RESET_PENDING) &&
+                   (strq->chunks_on_queues == 0) &&
                    TAILQ_EMPTY(&strq->outqueue)) {
                        stcb->asoc.trigger_reset = 1;
                }
@@ -11561,7 +11563,8 @@ sctp_add_stream_reset_out(struct sctp_tc
        /* now how long will this param be? */
        for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
                if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) 
&&
-                   (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) {
+                   (stcb->asoc.strmout[i].chunks_on_queues == 0) &&
+                   TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
                        number_entries++;
                }
        }
@@ -11584,7 +11587,8 @@ sctp_add_stream_reset_out(struct sctp_tc
        if (number_entries) {
                for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
                        if ((stcb->asoc.strmout[i].state == 
SCTP_STREAM_RESET_PENDING) &&
-                           (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) {
+                           (stcb->asoc.strmout[i].chunks_on_queues == 0) &&
+                           TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
                                req_out->list_of_streams[at] = htons(i);
                                at++;
                                stcb->asoc.strmout[i].state = 
SCTP_STREAM_RESET_IN_FLIGHT;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to