From d000072f222e7bf9bd434573b2fa40e8956dc1f8 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 8 Oct 2024 13:22:40 -0400 Subject: [PATCH] MT#55283 fix ext_seq math booboo 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 84b2d2c30e89573111bf75b2904a93ffc3468ab5) --- lib/codeclib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/codeclib.c b/lib/codeclib.c index c9dd53fc7..1ba2b9c58 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -1756,9 +1756,12 @@ out: 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; }