Author: tuexen
Date: Mon Mar 25 09:47:22 2019
New Revision: 345494
URL: https://svnweb.freebsd.org/changeset/base/345494

Log:
  Fix the handling of fragmented unordered messages when using DATA chunks
  and FORWARD-TSN.
  
  This bug was reported in https://github.com/sctplab/usrsctp/issues/286
  for the userland stack.
  
  This is joint work with rrs@.
  
  MFC after:            1 week

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c      Mon Mar 25 09:10:07 2019        
(r345493)
+++ head/sys/netinet/sctp_indata.c      Mon Mar 25 09:47:22 2019        
(r345494)
@@ -947,6 +947,15 @@ sctp_inject_old_unordered_data(struct sctp_tcb *stcb,
                SCTPDBG(SCTP_DEBUG_XXX,
                    "chunk is a first fsn: %u becomes fsn_included\n",
                    chk->rec.data.fsn);
+               at = TAILQ_FIRST(&control->reasm);
+               if (at && SCTP_TSN_GT(chk->rec.data.fsn, at->rec.data.fsn)) {
+                       /*
+                        * The first chunk in the reassembly is a smaller
+                        * TSN than this one, even though this has a first,
+                        * it must be from a subsequent msg.
+                        */
+                       goto place_chunk;
+               }
                if (control->first_frag_seen) {
                        /*
                         * In old un-ordered we can reassembly on one
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to