Commit:     d0cf0d9940ef27b46fcbbd9e0cc8427c30fe05eb
Parent:     fefaa75e0451c76225863644be01e4fd70884153
Author:     Vlad Yasevich <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 18 14:11:06 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 18 14:16:09 2007 -0700

    [SCTP]: Do not interleave non-fragments when in partial delivery
    The way partial delivery is currently implemnted, it is possible to
    intereleave a message (either from another steram, or unordered) that
    is not part of partial delivery process.  The only way to this is for
    a message to not be a fragment and be 'in order' or unorderd for a
    given stream.  This will result in bypassing the reassembly/ordering
    queues where things live duing partial delivery, and the
    message will be delivered to the socket in the middle of partial delivery.
    This is a two-fold problem, in that:
    1.  the app now must check the stream-id and flags which it may not
    be doing.
    2.  this clearing partial delivery state from the association and results
    in ulp hanging.
    This patch is a band-aid over a much bigger problem in that we
    don't do stream interleave.
    Signed-off-by: Vlad Yasevich <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 net/sctp/ulpqueue.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index bfb197e..b29e3e4 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -190,7 +190,14 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct 
sctp_ulpevent *event)
        if (!sctp_sk(sk)->pd_mode) {
                queue = &sk->sk_receive_queue;
        } else if (ulpq->pd_mode) {
-               if (event->msg_flags & MSG_NOTIFICATION)
+               /* If the association is in partial delivery, we
+                * need to finish delivering the partially processed
+                * packet before passing any other data.  This is
+                * because we don't truly support stream interleaving.
+                */
+               if ((event->msg_flags & MSG_NOTIFICATION) ||
+                   (SCTP_DATA_NOT_FRAG ==
+                           (event->msg_flags & SCTP_DATA_FRAG_MASK)))
                        queue = &sctp_sk(sk)->pd_lobby;
                else {
                        clear_pd = event->msg_flags & MSG_EOR;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to