From 9c47c860bcce8902ba714b96173dfaa65757322f Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@eurecom.fr>
Date: Fri, 23 Mar 2018 09:20:19 +0100
Subject: [PATCH] FlexRAN: RCconfig_flexran(): only read necessary information

if the FlexRAN agent is disabled, do not read all the data and skip reading
of more information
---
 openair2/ENB_APP/enb_config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index e0ab70154e..aa5bbdb3c7 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -137,6 +137,9 @@ void RCconfig_flexran()
                 sizeof(flexran_agent_info_t), i + 1, num_enbs);
     /* if config says "yes", enable Agent, in all other cases it's like "no" */
     RC.flexran[i]->enabled          = strcasecmp(*(flexranParams[FLEXRAN_ENABLED].strptr), "yes") == 0;
+    /* if not enabled, simply skip the rest, it is not needed anyway */
+    if (!RC.flexran[i]->enabled)
+      continue;
     RC.flexran[i]->interface_name   = strdup(*(flexranParams[FLEXRAN_INTERFACE_NAME_IDX].strptr));
     //inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN);
     RC.flexran[i]->remote_ipv4_addr = strdup(*(flexranParams[FLEXRAN_IPV4_ADDRESS_IDX].strptr));
-- 
GitLab