Skip to content

Commit

Permalink
MT#55283 fix ext_seq math booboo
Browse files Browse the repository at this point in the history
Fix the math in the sequencer code to determine ROC and extended
sequence number. This has become significant as the sequence numbers are
written into shared memory space.

Change-Id: I9e519a29a3822d02f7c389920ee0909b48828525
(cherry picked from commit 84b2d2c)
  • Loading branch information
rfuchs committed Oct 9, 2024
1 parent cef1401 commit d000072
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/codeclib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,9 +1756,12 @@ static void *__packet_sequencer_next_packet(packet_sequencer_t *ps, int num_wait
g_tree_steal(ps->packets, GINT_TO_POINTER(packet->seq));
ps->seq = (packet->seq + 1) & 0xffff;

if (packet->seq < ps->ext_seq)
unsigned int ext_seq = ps->roc << 16 | packet->seq;
while (ext_seq < ps->ext_seq) {
ps->roc++;
ps->ext_seq = ps->roc << 16 | packet->seq;
ext_seq += 0x10000;
}
ps->ext_seq = ext_seq;

return packet;
}
Expand Down

0 comments on commit d000072

Please sign in to comment.