From 43f5eecd19f7f604c637da99ae6d4165cfcac01d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 4 Sep 2023 12:13:46 +0200 Subject: [PATCH] nr rlc am: bugfix: use sn_compare_tx() to compare SNs The use of < is not correct. SNs are cyclic. We must use sn_compare_tx(). --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index 9e16451352..044572060b 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -437,9 +437,10 @@ process_next_pdu: goto process_retransmit_list_head; if (cur_retransmit_list == NULL) goto process_wait_list_head; - if (cur_wait_list->sdu->sn < cur_retransmit_list->sdu->sn - || (cur_wait_list->sdu->sn == cur_retransmit_list->sdu->sn && - cur_wait_list->so < cur_retransmit_list->so)) + cmp = sn_compare_tx(entity, cur_wait_list->sdu->sn, cur_retransmit_list->sdu->sn); + if (cmp < 0 + || (cmp == 0 + && cur_wait_list->so < cur_retransmit_list->so)) goto process_wait_list_head; goto process_retransmit_list_head;