From 189baf59bdaa3abe80db61747b8708cab73e72ae Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 23 Oct 2026 09:47:14 -0400 Subject: [PATCH] MT#55283 fix sequencer insert bug Closes #2220 Change-Id: I7e9936dbe67abeb3c88927d9cb5800d034ce75e4 (cherry picked from commit 9defebeac521d3bf02ae9311dc635d658c9f8e8c) --- lib/codeclib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/codeclib.c b/lib/codeclib.c index c7f06fd66..a7d0a984f 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -603,9 +603,11 @@ seq_ok:; if (ps->a_idx != idx) ret = 2; // indicates an out-of-order packet - // if not set - if (ps->a_nxt == -1u) - ps->a_nxt = idx; + // if not set and this is the first packet + if (ps->a_nxt == -1u) { + if (ret != 2) + ps->a_nxt = idx; + } // or if new idx is less than a_nxt else if ((ps->a_nxt - ps->a_idx) % G_N_ELEMENTS(ps->packets) > (idx - ps->a_idx) % G_N_ELEMENTS(ps->packets))