@@ -778,21 +778,6 @@ sctp_build_readq_entry_from_ctl(struct sctp_queued_to_read *nc, struct sctp_queu
778
778
nc -> do_not_ref_stcb = control -> do_not_ref_stcb ;
779
779
}
780
780
781
- static void
782
- sctp_reset_a_control (struct sctp_queued_to_read * control ,
783
- struct sctp_inpcb * inp , uint32_t tsn )
784
- {
785
- control -> fsn_included = tsn ;
786
- if (control -> on_read_q ) {
787
- /*
788
- * We have to purge it from there,
789
- * hopefully this will work :-)
790
- */
791
- TAILQ_REMOVE (& inp -> read_queue , control , next );
792
- control -> on_read_q = 0 ;
793
- }
794
- }
795
-
796
781
static int
797
782
sctp_handle_old_unordered_data (struct sctp_tcb * stcb ,
798
783
struct sctp_association * asoc ,
@@ -1923,7 +1908,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
1923
1908
SCTP_SNPRINTF (msg , sizeof (msg ), "Duplicate MID=%8.8x detected." , mid );
1924
1909
goto err_out ;
1925
1910
} else {
1926
- if ((tsn == control -> fsn_included + 1 ) &&
1911
+ if ((control -> first_frag_seen ) &&
1912
+ (tsn == control -> fsn_included + 1 ) &&
1927
1913
(control -> end_added == 0 )) {
1928
1914
SCTP_SNPRINTF (msg , sizeof (msg ),
1929
1915
"Illegal message sequence, missing end for MID: %8.8x" ,
@@ -5497,12 +5483,25 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb,
5497
5483
sctp_free_a_chunk (stcb , chk , SCTP_SO_NOT_LOCKED );
5498
5484
}
5499
5485
if (!TAILQ_EMPTY (& control -> reasm )) {
5500
- /* This has to be old data, unordered */
5486
+ KASSERT (!asoc -> idata_supported ,
5487
+ ("Reassembly queue not empty for I-DATA" ));
5488
+ KASSERT (!ordered ,
5489
+ ("Reassembly queue not empty for ordered data" ));
5501
5490
if (control -> data ) {
5502
5491
sctp_m_freem (control -> data );
5503
5492
control -> data = NULL ;
5504
5493
}
5505
- sctp_reset_a_control (control , stcb -> sctp_ep , cumtsn );
5494
+ control -> fsn_included = 0xffffffff ;
5495
+ control -> first_frag_seen = 0 ;
5496
+ control -> last_frag_seen = 0 ;
5497
+ if (control -> on_read_q ) {
5498
+ /*
5499
+ * We have to purge it from there,
5500
+ * hopefully this will work :-)
5501
+ */
5502
+ TAILQ_REMOVE (& stcb -> sctp_ep -> read_queue , control , next );
5503
+ control -> on_read_q = 0 ;
5504
+ }
5506
5505
chk = TAILQ_FIRST (& control -> reasm );
5507
5506
if (chk -> rec .data .rcv_flags & SCTP_DATA_FIRST_FRAG ) {
5508
5507
TAILQ_REMOVE (& control -> reasm , chk , sctp_next );
0 commit comments