- uint32_t i, min = sess_local[(this_bundle->members[0])].last_seq;;
- for (i = 1; i < this_bundle->num_of_links; i++)
+ /* seq # can be spread over the wrapping limit, and we must
+ choose the "lowest" one, taking into account the wrapping:
+
+ |-#-##--#----------------------M--###-#|
+
+ but we must also care when the last highest seq # wraps,
+ so we keep two minimums: one for the higher limit, and
+ one for the lower one.
+
+ In the nominal case, low_min = high_min.
+ */
+ uint32_t i, low_min, high_min;
+ low_min = sess_local[(this_bundle->members[0])].last_seq;;
+ high_min = this_bundle->max_seq; // max_seq is impossible to reach
+
+ for (i = 0; i < this_bundle->num_of_links; i++)