Commit bd36a9ef authored by Robert Schmidt's avatar Robert Schmidt

Gracefully handle different numbers of UE in MAC and RRC

parent a4d909bc
...@@ -593,9 +593,11 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl ...@@ -593,9 +593,11 @@ int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__Fl
if (flexran_agent_get_rrc_xface(mod_id) && flexran_agent_get_mac_xface(mod_id) if (flexran_agent_get_rrc_xface(mod_id) && flexran_agent_get_mac_xface(mod_id)
&& flexran_get_rrc_num_ues(mod_id) != flexran_get_mac_num_ues(mod_id)) { && flexran_get_rrc_num_ues(mod_id) != flexran_get_mac_num_ues(mod_id)) {
LOG_E(FLEXRAN_AGENT, "different numbers of UEs in RRC (%d) and MAC (%d)\n", const int nrrc = flexran_get_rrc_num_ues(mod_id);
flexran_get_rrc_num_ues(mod_id), flexran_get_mac_num_ues(mod_id)); const int nmac = flexran_get_mac_num_ues(mod_id);
goto error; ue_config_reply_msg->n_ue_config = nrrc < nmac ? nrrc : nmac;
LOG_E(FLEXRAN_AGENT, "%s(): different numbers of UEs in RRC (%d) and MAC (%d), reporting for %lu UEs\n",
__func__, nrrc, nmac, ue_config_reply_msg->n_ue_config);
} }
Protocol__FlexUeConfig **ue_config; Protocol__FlexUeConfig **ue_config;
......
...@@ -250,9 +250,11 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr ...@@ -250,9 +250,11 @@ int flexran_agent_handle_stats(mid_t mod_id, const void *params, Protocol__Flexr
if (flexran_agent_get_rrc_xface(mod_id) && flexran_agent_get_mac_xface(mod_id) if (flexran_agent_get_rrc_xface(mod_id) && flexran_agent_get_mac_xface(mod_id)
&& flexran_get_rrc_num_ues(mod_id) != flexran_get_mac_num_ues(mod_id)) { && flexran_get_rrc_num_ues(mod_id) != flexran_get_mac_num_ues(mod_id)) {
LOG_E(FLEXRAN_AGENT, "different numbers of UEs in RRC (%d) and MAC (%d)\n", const int nrrc = flexran_get_rrc_num_ues(mod_id);
flexran_get_rrc_num_ues(mod_id), flexran_get_mac_num_ues(mod_id)); const int nmac = flexran_get_mac_num_ues(mod_id);
goto error; report_config.nr_ue = nrrc < nmac ? nrrc : nmac;
LOG_E(FLEXRAN_AGENT, "%s(): different numbers of UEs in RRC (%d) and MAC (%d), reporting for %d UEs\n",
__func__, nrrc, nmac, report_config.nr_ue);
} }
report_config.ue_report_type = malloc(sizeof(ue_report_type_t) * report_config.nr_ue); report_config.ue_report_type = malloc(sizeof(ue_report_type_t) * report_config.nr_ue);
if (report_config.ue_report_type == NULL) { if (report_config.ue_report_type == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment