From 6e5a2f45ced70f7ecbc6027048da9ac8ed0d4b97 Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@eurecom.fr>
Date: Sun, 20 May 2018 17:12:15 +0200
Subject: [PATCH] FlexRAN: set deleted slice configuration to zero

---
 openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
index 0985539f8c..1e091feba5 100644
--- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
+++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
@@ -1421,6 +1421,7 @@ void flexran_check_and_remove_slices(mid_t mod_id)
     /* don't update slice_config, it will be read in below */
     /* we need to memcpy the higher slice to the position we just deleted */
     memcpy(dl[i], dl[n_dl-1], sizeof(*dl[n_dl-1]));
+    memset(dl[n_dl-1], 0, sizeof(*dl[n_dl-1]));
     --sc_update[mod_id]->n_dl;
   }
   Protocol__FlexUlSlice **ul = sc_update[mod_id]->ul;
@@ -1436,6 +1437,7 @@ void flexran_check_and_remove_slices(mid_t mod_id)
           mod_id, i, ul[i]->id);
     /* see DL remarks */
     memcpy(ul[i], ul[n_ul-1], sizeof(*ul[n_ul-1]));
+    memset(ul[n_ul-1], 0, sizeof(*ul[n_ul-1]));
     --sc_update[mod_id]->n_ul;
   }
 }
-- 
GitLab