From c824eea0745e19b0f0a2604e67aaa4cb47ff3707 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Fri, 20 Jan 2017 15:21:37 +0100
Subject: [PATCH] better (maybe) freeing of RA process when an UE is removed
 from MAC

The RA process may be in the state:
RA_active == FALSE and wait_ack_Msg4 == 1

Testing only the rnti should be enough, if everything else works
properly.

Also, don't break, just in case. (Not sure it makes a
difference.)
---
 openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
index 71cbb36ce9..3cf36eaa8d 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
@@ -365,8 +365,7 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
   RA_TEMPLATE *RA_template;
   for (i=0;i<NB_RA_PROC_MAX;i++) {
     RA_template = (RA_TEMPLATE *)&eNB_mac_inst[mod_idP].common_channels[pCC_id].RA_template[i];
-    if ((RA_template->RA_active == TRUE) && 
-	(RA_template->rnti == rntiP)){
+    if (RA_template->rnti == rntiP){
       RA_template->RA_active=FALSE;
       RA_template->generate_rar=0;
       RA_template->generate_Msg4=0;
@@ -374,7 +373,7 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
       RA_template->timing_offset=0;
       RA_template->RRC_timer=20;
       RA_template->rnti = 0;
-      break;
+      //break;
     }
   }
   if (ret == 0) {
-- 
GitLab