+ for (i = 0; i < this_bundle->num_of_links; i++)
+ {
+ uint32_t s_seq = sess_local[(this_bundle->members[i])].last_seq;
+ if (s_seq < low_min)
+ low_min = s_seq;
+ if (s_seq >= this_fragmentation->M && s_seq < high_min)
+ high_min = s_seq;
+ }
+
+ // if high_min was found, it's the "lowest" one
+ if (high_min < this_bundle->max_seq)
+ this_fragmentation->M = high_min;
+ else
+ this_fragmentation->M = low_min;
+ }
+
+ LOG(4, s, t, "MPPP: Setting M to %d\n", this_fragmentation->M);
+ //calculate M's offset from the begin seq in the bundle
+ M_offset = (this_fragmentation->M + this_bundle->max_seq - this_fragmentation->start_seq) & (this_bundle->max_seq-1);
+
+ //caculate M's index in the fragment array
+ M_index = (M_offset + this_fragmentation->start_index) & MAXFRAGNUM_MASK;
+
+ //caculate received fragment's index in the fragment array
+ frag_index = (frag_offset + this_fragmentation->start_index) & MAXFRAGNUM_MASK;
+
+ //frame with a single fragment
+ if (begin_frame && end_frame)
+ {
+ // process and reset fragmentation
+ LOG(4, s, t, "MPPP: Both bits are set (Begin and End).\n");
+ this_fragmentation->fragment[frag_index].length = l;
+ this_fragmentation->fragment[frag_index].sid = s;
+ this_fragmentation->fragment[frag_index].flags = flags;
+ this_fragmentation->fragment[frag_index].seq = seq_num;
+ this_fragmentation->re_frame_begin_index = frag_index;
+ this_fragmentation->re_frame_end_index = frag_index;
+ processmpframe(s, t, p, l, 0);
+ this_fragmentation->fragment[frag_index].length = 0;
+ this_fragmentation->fragment[frag_index].flags = 0;
+ end_index = frag_index;
+ }
+ else