From 8d284f48bd20a0a887d6e0e59dabdeb8c65b5a09 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 12 Feb 2020 17:34:58 +0100 Subject: [PATCH] cancel RA when receiving contention resolution in wrong state this fixes a bug in which the contention resolution timer expired and the RA proc entered the BACKOFF state. In the same TTI, a MAC PDU with the contention reslution ID is received and the already aborted RA procedure succeeds. Unfortunatly with the wront c-rnti which has already been reset before. See log excerpt below: 16:16:36.909687 [RRC ] [D] MEAS: Processing measurement of 1 cells 16:16:36.909706 [RRC ] [I] MEAS: New measurement serving cell: rsrp=-85.00 dBm. 16:16:36.909732 [MAC ] [I] [ 6283] RA: ConRes: Contention Resolution Timer expired. Stopping PDCCH Search and going to Response Error 16:16:36.909749 [MAC ] [D] [ 6283] RA: ConRes: Backoff wait interval 143 16:16:36.909771 [MAC ] [D] [ 6282] Delivering PDU=27 bytes to Dissassemble and Demux unit (Temporal C-RNTI) 16:16:36.909799 [MAC ] [D] [ 6283] Found Contention Resolution ID CE 16:16:36.909814 [MAC ] [D] [ 6283] RA: Backof: MAC PDU Contains Contention Resolution ID CE 16:16:36.909826 [MAC ] [D] [ 6283] Msg3 buffer flushed 16:16:36.909858 [MAC ] [I] [ 6283] RA: Backof: Random Access Complete. c-rnti=0x0, ta=0 16:16:36.909871 [MAC ] [D] [ 6283] Saved MAC PDU with Temporal C-RNTI in buffer --- srsue/src/stack/mac/proc_ra.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index 32b84bc73..89dfe9b32 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -572,6 +572,11 @@ bool ra_proc::contention_resolution_id_received(uint64_t rx_contention_id) rDebug("MAC PDU Contains Contention Resolution ID CE\n"); + if (state != CONTENTION_RESOLUTION) { + rError("Received contention resolution in wrong state. Aborting.\n"); + response_error(); + } + // MAC PDU successfully decoded and contains MAC CE contention Id contention_resolution_timer.stop();