MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_inject_old_unordered_data

Function sctp_inject_old_unordered_data

freebsd/netinet/sctp_indata.c:912–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

910}
911
912static void
913sctp_inject_old_unordered_data(struct sctp_tcb *stcb,
914 struct sctp_association *asoc,
915 struct sctp_queued_to_read *control,
916 struct sctp_tmit_chunk *chk,
917 int *abort_flag)
918{
919 struct sctp_tmit_chunk *at;
920 int inserted;
921
922 /*
923 * Here we need to place the chunk into the control structure sorted
924 * in the correct order.
925 */
926 if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) {
927 /* Its the very first one. */
928 SCTPDBG(SCTP_DEBUG_XXX,
929 "chunk is a first fsn: %u becomes fsn_included\n",
930 chk->rec.data.fsn);
931 at = TAILQ_FIRST(&control->reasm);
932 if (at && SCTP_TSN_GT(chk->rec.data.fsn, at->rec.data.fsn)) {
933 /*
934 * The first chunk in the reassembly is a smaller
935 * TSN than this one, even though this has a first,
936 * it must be from a subsequent msg.
937 */
938 goto place_chunk;
939 }
940 if (control->first_frag_seen) {
941 /*
942 * In old un-ordered we can reassembly on one
943 * control multiple messages. As long as the next
944 * FIRST is greater then the old first (TSN i.e. FSN
945 * wise)
946 */
947 struct mbuf *tdata;
948 uint32_t tmp;
949
950 if (SCTP_TSN_GT(chk->rec.data.fsn, control->fsn_included)) {
951 /*
952 * Easy way the start of a new guy beyond
953 * the lowest
954 */
955 goto place_chunk;
956 }
957 if ((chk->rec.data.fsn == control->fsn_included) ||
958 (control->pdapi_started)) {
959 /*
960 * Ok this should not happen, if it does we
961 * started the pd-api on the higher TSN
962 * (since the equals part is a TSN failure
963 * it must be that).
964 *
965 * We are completly hosed in that case since
966 * I have no way to recover. This really
967 * will only happen if we can get more TSN's
968 * higher before the pd-api-point.
969 */

Callers 1

Calls 3

sctp_abort_in_reasmFunction · 0.85
sctp_setup_tail_pointerFunction · 0.85
sctp_mark_non_revokableFunction · 0.85

Tested by

no test coverage detected