Merge remote-tracking branch 'origin/434-coverity-scan-fix-week25' into develop_integration_2019_w25
This commit is contained in:
@@ -358,6 +358,7 @@ hashtable_rc_t hashtable_resize(hash_table_t *const hashtblP, const hash_size_t
|
||||
|
||||
newtbl.size = sizeP;
|
||||
newtbl.hashfunc = hashtblP->hashfunc;
|
||||
newtbl.num_elements = 0;
|
||||
|
||||
if(!(newtbl.nodes=calloc(sizeP, sizeof(hash_node_t *)))) return -1;
|
||||
|
||||
|
||||
@@ -540,6 +540,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
|
||||
}
|
||||
|
||||
if(req->nfapi_config.earfcn.tl.tag == NFAPI_NFAPI_EARFCN_TAG) {
|
||||
fp->eutra_band = 0;
|
||||
fp->dl_CarrierFreq = from_earfcn(fp->eutra_band, req->nfapi_config.earfcn.value);
|
||||
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_uldl_offset(fp->eutra_band) * 1e5);
|
||||
num_tlv++;
|
||||
|
||||
@@ -327,6 +327,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
uint16_t *j = NULL;
|
||||
|
||||
openair0_timestamp timestamp[spsf / spp_eth];
|
||||
memset(timestamp, 0, sizeof(timestamp));
|
||||
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5, 1 );
|
||||
@@ -606,7 +607,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
free(rx_buffer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
|
||||
subframe,num_pdcch_symbols,amp,frame_parms->nb_antenna_ports_eNB,frame_parms->Ncp);
|
||||
#endif
|
||||
|
||||
memset(pcfich_bt, 0, sizeof(pcfich_bt));
|
||||
|
||||
// scrambling
|
||||
if ((num_pdcch_symbols>0) && (num_pdcch_symbols<4))
|
||||
pcfich_scrambling(frame_parms,subframe,pcfich_b[num_pdcch_symbols-1],pcfich_bt);
|
||||
|
||||
@@ -81,7 +81,7 @@ static int tun_alloc(char *dev) {
|
||||
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
|
||||
|
||||
if( *dev )
|
||||
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
|
||||
strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)-1);
|
||||
|
||||
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
|
||||
close(fd);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#ifndef S1AP_MESSAGES_TYPES_H_
|
||||
#define S1AP_MESSAGES_TYPES_H_
|
||||
|
||||
#include "LTE_asn_constant.h"
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Defines to access message fields.
|
||||
|
||||
@@ -62,7 +63,7 @@
|
||||
/* Maximum number of e-rabs to be setup/deleted in a single message.
|
||||
* Even if only one bearer will be modified by message.
|
||||
*/
|
||||
#define S1AP_MAX_E_RAB 11
|
||||
#define S1AP_MAX_E_RAB (LTE_maxDRB + 3)
|
||||
|
||||
/* Length of the transport layer address string
|
||||
* 160 bits / 8 bits by char.
|
||||
|
||||
@@ -192,8 +192,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
for (j = 0; j < dl_report->n_csi_report; j++) {
|
||||
|
||||
csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi));
|
||||
if (csi_reports[j] == NULL)
|
||||
if (csi_reports[j] == NULL) {
|
||||
for (k = 0; k < j; k++) {
|
||||
free(csi_reports[k]);
|
||||
}
|
||||
free(csi_reports);
|
||||
csi_reports = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_dl_csi__init(csi_reports[j]);
|
||||
//The servCellIndex for this report
|
||||
csi_reports[j]->serv_cell_index = j;
|
||||
@@ -213,8 +219,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
|
||||
Protocol__FlexCsiP10 *csi10;
|
||||
csi10 = malloc(sizeof(Protocol__FlexCsiP10));
|
||||
if (csi10 == NULL)
|
||||
goto error;
|
||||
if (csi10 == NULL) {
|
||||
for (k = 0; k <= j; k++) {
|
||||
free(csi_reports[k]);
|
||||
}
|
||||
free(csi_reports);
|
||||
csi_reports = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_csi_p10__init(csi10);
|
||||
//TODO: set the wideband value
|
||||
// NN: this is also depends on cc_id
|
||||
@@ -229,8 +241,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
|
||||
Protocol__FlexCsiP11 *csi11;
|
||||
csi11 = malloc(sizeof(Protocol__FlexCsiP11));
|
||||
if (csi11 == NULL)
|
||||
goto error;
|
||||
if (csi11 == NULL) {
|
||||
for (k = 0; k <= j; k++) {
|
||||
free(csi_reports[k]);
|
||||
}
|
||||
free(csi_reports);
|
||||
csi_reports = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_csi_p11__init(csi11);
|
||||
|
||||
csi11->wb_cqi = malloc(sizeof(csi11->wb_cqi));
|
||||
@@ -274,8 +292,14 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
|
||||
Protocol__FlexCsiP20 *csi20;
|
||||
csi20 = malloc(sizeof(Protocol__FlexCsiP20));
|
||||
if (csi20 == NULL)
|
||||
goto error;
|
||||
if (csi20 == NULL) {
|
||||
for (k = 0; k <= j; k++) {
|
||||
free(csi_reports[k]);
|
||||
}
|
||||
free(csi_reports);
|
||||
csi_reports = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_csi_p20__init(csi20);
|
||||
|
||||
csi20->wb_cqi = flexran_get_ue_wcqi (enb_id, UE_id);
|
||||
@@ -417,7 +441,12 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
|
||||
for (j = 0; j < paging_report->n_paging_info; j++) {
|
||||
|
||||
p_info[j] = malloc(sizeof(Protocol__FlexPagingInfo));
|
||||
if(p_info[j] == NULL){
|
||||
if (p_info[j] == NULL) {
|
||||
for (k = 0; k < j; k++) {
|
||||
free(p_info[k]);
|
||||
}
|
||||
free(p_info);
|
||||
p_info = NULL;
|
||||
free(paging_report);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -361,6 +361,14 @@ Protocol__FlexDlCqiReport * copy_dl_cqi_report(Protocol__FlexDlCqiReport * origi
|
||||
|
||||
error:
|
||||
/*TODO: Must free memory properly*/
|
||||
if (dl_report != NULL) {
|
||||
if (csi_reports != NULL) {
|
||||
free(csi_reports);
|
||||
csi_reports = NULL;
|
||||
}
|
||||
free(dl_report);
|
||||
dl_report = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -555,6 +563,74 @@ Protocol__FlexDlCsi * copy_csi_report(Protocol__FlexDlCsi * original) {
|
||||
return copy;
|
||||
|
||||
error:
|
||||
if (copy != NULL) {
|
||||
if ((copy->p11csi != NULL) && (copy->p11csi->wb_cqi != NULL)) {
|
||||
free(copy->p11csi->wb_cqi);
|
||||
copy->p11csi->wb_cqi = NULL;
|
||||
}
|
||||
if (copy->p21csi != NULL) {
|
||||
if (copy->p21csi->wb_cqi != NULL) {
|
||||
free(copy->p21csi->wb_cqi);
|
||||
copy->p21csi->wb_cqi = NULL;
|
||||
}
|
||||
if (copy->p21csi->sb_cqi != NULL) {
|
||||
free(copy->p21csi->sb_cqi);
|
||||
copy->p21csi->sb_cqi = NULL;
|
||||
}
|
||||
}
|
||||
if (copy->a12csi != NULL) {
|
||||
if (copy->a12csi->wb_cqi != NULL) {
|
||||
free(copy->a12csi->wb_cqi);
|
||||
copy->a12csi->wb_cqi = NULL;
|
||||
}
|
||||
if (copy->a12csi->sb_pmi != NULL) {
|
||||
free(copy->a12csi->sb_pmi);
|
||||
copy->a12csi->sb_pmi = NULL;
|
||||
}
|
||||
}
|
||||
if (copy->a22csi != NULL) {
|
||||
if (copy->a22csi->wb_cqi != NULL) {
|
||||
free(copy->a22csi->wb_cqi);
|
||||
copy->a22csi->wb_cqi = NULL;
|
||||
}
|
||||
if (copy->a22csi->sb_cqi != NULL) {
|
||||
free(copy->a22csi->sb_cqi);
|
||||
copy->a22csi->sb_cqi = NULL;
|
||||
}
|
||||
if (copy->a22csi->sb_list != NULL) {
|
||||
free(copy->a22csi->sb_list);
|
||||
copy->a22csi->sb_list = NULL;
|
||||
}
|
||||
}
|
||||
if ((copy->a20csi != NULL) && (copy->a20csi->sb_list != NULL)) {
|
||||
free(copy->a20csi->sb_list);
|
||||
copy->a20csi->sb_list = NULL;
|
||||
}
|
||||
if ((copy->a30csi != NULL) && (copy->a30csi->sb_cqi != NULL)) {
|
||||
free(copy->a30csi->sb_cqi);
|
||||
copy->a30csi->sb_cqi = NULL;
|
||||
}
|
||||
if (copy->a31csi != NULL) {
|
||||
if (copy->a31csi->wb_cqi != NULL) {
|
||||
free(copy->a31csi->wb_cqi);
|
||||
copy->a31csi->wb_cqi = NULL;
|
||||
}
|
||||
if (copy->a31csi->sb_cqi != NULL) {
|
||||
for (i = 0; i < copy->a31csi->n_sb_cqi; i++) {
|
||||
if (copy->a31csi->sb_cqi[i] != NULL) {
|
||||
if (copy->a31csi->sb_cqi[i]->sb_cqi != NULL) {
|
||||
free(copy->a31csi->sb_cqi[i]->sb_cqi);
|
||||
}
|
||||
free(copy->a31csi->sb_cqi[i]);
|
||||
}
|
||||
}
|
||||
free(copy->a31csi->sb_cqi);
|
||||
copy->a31csi->sb_cqi = NULL;
|
||||
}
|
||||
}
|
||||
free(copy);
|
||||
copy = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1650,6 +1726,10 @@ int apply_ue_slice_assoc_update(mid_t mod_id)
|
||||
int changes = 0;
|
||||
for (i = 0; i < n_ue_slice_assoc_updates; i++) {
|
||||
int ue_id = find_UE_id(mod_id, ue_slice_assoc_update[i]->rnti);
|
||||
if (ue_id < 0 || ue_id > MAX_MOBILES_PER_ENB){
|
||||
LOG_E(FLEXRAN_AGENT,"UE_id %d is wrong!!\n",ue_id);
|
||||
continue;
|
||||
}
|
||||
if (ue_slice_assoc_update[i]->has_dl_slice_id) {
|
||||
int slice_idx = flexran_find_dl_slice(mod_id, ue_slice_assoc_update[i]->dl_slice_id);
|
||||
if (flexran_dl_slice_exists(mod_id, slice_idx)) {
|
||||
|
||||
@@ -400,8 +400,11 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
|
||||
/* Target Cell, Neghibouring*/
|
||||
Protocol__FlexNeighCellsMeasurements *neigh_meas;
|
||||
neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements));
|
||||
if (neigh_meas == NULL)
|
||||
if (neigh_meas == NULL) {
|
||||
free(rrc_measurements);
|
||||
rrc_measurements = NULL;
|
||||
goto error;
|
||||
}
|
||||
protocol__flex_neigh_cells_measurements__init(neigh_meas);
|
||||
|
||||
|
||||
@@ -412,8 +415,12 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
|
||||
if (neigh_meas->n_eutra_meas > 0){
|
||||
|
||||
eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas);
|
||||
if (eutra_meas == NULL)
|
||||
if (eutra_meas == NULL) {
|
||||
free(neigh_meas);
|
||||
free(rrc_measurements);
|
||||
rrc_measurements = NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){
|
||||
|
||||
@@ -423,6 +430,9 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
|
||||
free(eutra_meas[k]);
|
||||
}
|
||||
free(eutra_meas);
|
||||
free(neigh_meas);
|
||||
free(rrc_measurements);
|
||||
rrc_measurements = NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -453,6 +463,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
|
||||
|
||||
rrc_measurements->neigh_meas = neigh_meas;
|
||||
|
||||
} else {
|
||||
free(neigh_meas);
|
||||
}
|
||||
|
||||
ue_report[i]->rrc_measurements = rrc_measurements;
|
||||
|
||||
@@ -818,6 +818,8 @@ int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__Fl
|
||||
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(&ctxt, ue_context_p, 0, reconf_param);
|
||||
}
|
||||
*msg = NULL;
|
||||
free(reconf_param);
|
||||
reconf_param = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -745,11 +745,14 @@ err_code_t flexran_agent_enable_cont_stats_update(mid_t mod_id,
|
||||
Protocol__FlexranMessage *req_msg = NULL;
|
||||
|
||||
flexran_agent_stats_request(mod_id, xid, stats_req, &req_msg);
|
||||
stats_context[mod_id].stats_req = req_msg;
|
||||
stats_context[mod_id].prev_stats_reply = NULL;
|
||||
|
||||
stats_context[mod_id].cont_update = 1;
|
||||
stats_context[mod_id].xid = xid;
|
||||
if (req_msg != NULL) {
|
||||
stats_context[mod_id].stats_req = req_msg;
|
||||
stats_context[mod_id].prev_stats_reply = NULL;
|
||||
|
||||
stats_context[mod_id].cont_update = 1;
|
||||
stats_context[mod_id].xid = xid;
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(stats_context[mod_id].mutex)) {
|
||||
goto error;
|
||||
|
||||
@@ -77,6 +77,7 @@ flexran_agent_task_queue_t *flexran_agent_task_queue_init(mid_t mod_id, size_t c
|
||||
if (queue == NULL)
|
||||
goto error;
|
||||
|
||||
queue->mutex = NULL;
|
||||
/* If no comparator was given, use the default one */
|
||||
if (cmp == NULL)
|
||||
queue->cmp = _flexran_agent_task_queue_cmp;
|
||||
|
||||
@@ -248,6 +248,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
|
||||
} else {
|
||||
CU_send_F1_SETUP_FAILURE(instance);
|
||||
itti_free(TASK_RRC_ENB,message_p);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -370,6 +371,8 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
|
||||
cells_to_be_activated_list_itemExtIEs);
|
||||
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_160P9_t;
|
||||
|
||||
free(gNB_CUSystemInformation);
|
||||
gNB_CUSystemInformation = NULL;
|
||||
}
|
||||
/* ADD */
|
||||
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
|
||||
|
||||
@@ -143,6 +143,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
int f1ap_uid = f1ap_add_ue(&f1ap_cu_inst[rrc_inst], rrc_inst, CC_id, 0, rnti);
|
||||
if (f1ap_uid < 0 ) {
|
||||
LOG_E(F1AP, "Failed to add UE \n");
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
return -1;
|
||||
}
|
||||
f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
|
||||
|
||||
@@ -398,6 +398,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
|
||||
LTE_SRB_ToAddModList_t *SRB_configList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->srb_ToAddModList;
|
||||
LTE_DRB_ToReleaseList_t *DRB_ReleaseList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->drb_ToReleaseList;
|
||||
LTE_MAC_MainConfig_t *mac_MainConfig = NULL;
|
||||
for (i = 0; i< 8; i++){
|
||||
DRB2LCHAN[i] = 0;
|
||||
}
|
||||
if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig)
|
||||
mac_MainConfig = &rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
|
||||
LTE_MeasGapConfig_t *measGapConfig = NULL;
|
||||
|
||||
@@ -144,6 +144,8 @@ uint32_t to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw) {
|
||||
|
||||
for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(i < BANDTABLE_SIZE, "i %d >= BANDTABLE_SIZE %ld\n", i, BANDTABLE_SIZE);
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %u Hz < %u\n",
|
||||
eutra_bandP, bw, dl_CarrierFreq,
|
||||
@@ -165,6 +167,7 @@ uint32_t to_earfcn_DL(int eutra_bandP, long long int dl_CarrierFreq, uint32_t bw
|
||||
|
||||
for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(i < BANDTABLE_SIZE, "i = %d , it will trigger out-of-bounds read.\n",i);
|
||||
AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %lld Hz < %u\n",
|
||||
eutra_bandP, bw, dl_CarrierFreq,
|
||||
@@ -186,6 +189,7 @@ uint32_t to_earfcn_UL(int eutra_bandP, long long int ul_CarrierFreq, uint32_t bw
|
||||
|
||||
for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(i < BANDTABLE_SIZE, "i = %d , it will trigger out-of-bounds read.\n",i);
|
||||
AssertFatal(ul_CarrierFreq_by_100k >= eutra_bandtable[i].ul_min,
|
||||
"Band %d, bw %u : UL carrier frequency %lld Hz < %u\n",
|
||||
eutra_bandP, bw, ul_CarrierFreq,
|
||||
@@ -205,6 +209,8 @@ uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) {
|
||||
|
||||
for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(i < BANDTABLE_SIZE, "i %d >= BANDTABLE_SIZE %ld\n", i, BANDTABLE_SIZE);
|
||||
|
||||
return (eutra_bandtable[i].dl_min +
|
||||
(dl_earfcn - (eutra_bandtable[i].N_OFFs_DL / 10))) * 100000;
|
||||
}
|
||||
@@ -215,6 +221,8 @@ int32_t get_uldl_offset(int eutra_bandP) {
|
||||
|
||||
for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(i < BANDTABLE_SIZE, "i %d >= BANDTABLE_SIZE %ld\n", i, BANDTABLE_SIZE);
|
||||
|
||||
return (eutra_bandtable[i].dl_min - eutra_bandtable[i].ul_min);
|
||||
}
|
||||
|
||||
|
||||
@@ -3014,8 +3014,9 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=UE_template->TBS_UL[harq_pid];
|
||||
|
||||
if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED)
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs_rv,first_rb[CC_id],rb_table[rb_table_index],rb_table_index,UE_template->TBS_UL[harq_pid],harq_pid);
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs_rv,first_rb[CC_id],ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb,UE_template->TBS_UL[harq_pid],harq_pid);
|
||||
|
||||
|
||||
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
|
||||
//store for possible retransmission
|
||||
|
||||
@@ -65,7 +65,7 @@ get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id,
|
||||
uint8_t mbsfn_sync_area)
|
||||
{
|
||||
// currently there is one-to-one mapping between sf allocation pattern and sync area
|
||||
if (mbsfn_sync_area > MAX_MBSFN_AREA) {
|
||||
if (mbsfn_sync_area >= MAX_MBSFN_AREA) {
|
||||
LOG_W(MAC,
|
||||
"[eNB %d] CC_id %d MBSFN synchronization area %d out of range\n ",
|
||||
module_idP, CC_id, mbsfn_sync_area);
|
||||
|
||||
@@ -5139,8 +5139,8 @@ nack_or_dtx_reported(COMMON_channels_t *cc,
|
||||
if (cc->tdd_Config) {
|
||||
nfapi_harq_indication_tdd_rel13_t *hi = &harq_pdu->harq_indication_tdd_rel13;
|
||||
|
||||
for (i = 0; i < hi->number_of_ack_nack; hi++) {
|
||||
if (hi->harq_data[0].bundling.value_0 != 1) //only bundling is used for tdd for now
|
||||
for (i = 0; i < hi->number_of_ack_nack; i++) {
|
||||
if (hi->harq_data[i].bundling.value_0 != 1) //only bundling is used for tdd for now
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -5149,7 +5149,7 @@ nack_or_dtx_reported(COMMON_channels_t *cc,
|
||||
|
||||
nfapi_harq_indication_fdd_rel13_t *hi = &harq_pdu->harq_indication_fdd_rel13;
|
||||
|
||||
for (i = 0; i < hi->number_of_ack_nack; hi++) {
|
||||
for (i = 0; i < hi->number_of_ack_nack; i++) {
|
||||
if (hi->harq_tb_n[i] != 1)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -280,6 +280,8 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame,
|
||||
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
|
||||
cc = &RC.mac[Mod_id]->common_channels[CC_id];
|
||||
UE_id = find_UE_id(Mod_id, rnti);
|
||||
if(UE_id == -1)
|
||||
continue;
|
||||
harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frame,subframe);
|
||||
round = UE_list->UE_sched_ctrl[UE_id].round[CC_id][harq_pid];
|
||||
|
||||
@@ -302,6 +304,8 @@ maxround_ul(module_id_t Mod_id, uint16_t rnti, int sched_frame,
|
||||
for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) {
|
||||
cc = &RC.mac[Mod_id]->common_channels[CC_id];
|
||||
UE_id = find_UE_id(Mod_id, rnti);
|
||||
if(UE_id == -1)
|
||||
continue;
|
||||
harq_pid = subframe2harqpid(cc, sched_frame, sched_subframe);
|
||||
round = UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid];
|
||||
|
||||
|
||||
@@ -504,7 +504,7 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
|
||||
//int optval;
|
||||
int bytes_received;
|
||||
sidelink_pc5s_element *sl_pc5s_msg_send = NULL;
|
||||
pc5s_header_t *pc5s_header;
|
||||
pc5s_header_t *pc5s_header = NULL;
|
||||
rb_id_t rab_id = 0;
|
||||
//TTN for D2D (PC5S)
|
||||
// receive a message from ProSe App
|
||||
@@ -680,6 +680,10 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
|
||||
break;
|
||||
} /* end of switch */
|
||||
}/* end of bytes_received > 0 */
|
||||
if (pc5s_header != NULL) {
|
||||
free(pc5s_header);
|
||||
pc5s_header = NULL;
|
||||
}
|
||||
} /* pdcp_fifo_read_input_sdus_frompc5s */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -811,6 +811,7 @@ rlc_am_mac_data_request (
|
||||
tb_p = tb_p->next;
|
||||
} /* while */
|
||||
} /* MESSAGE_CHART_GENERATOR && data_req.data.nb_elements > 0 */
|
||||
data_req.buffer_occupancy_in_pdus = 0;
|
||||
|
||||
return data_req;
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ rlc_tm_mac_status_indication (
|
||||
status_resp.buffer_occupancy_in_bytes = ((rlc_tm_entity_t *) rlc_pP)->buffer_occupancy;
|
||||
status_resp.buffer_occupancy_in_pdus = status_resp.buffer_occupancy_in_bytes / ((rlc_tm_entity_t *) rlc_pP)->rlc_pdu_size;
|
||||
status_resp.rlc_info.rlc_protocol_state = ((rlc_tm_entity_t *) rlc_pP)->protocol_state;
|
||||
status_resp.head_sdu_creation_time = 0;
|
||||
return status_resp;
|
||||
}
|
||||
|
||||
@@ -185,6 +186,7 @@ rlc_tm_mac_data_request (
|
||||
PROTOCOL_RLC_TM_CTXT_ARGS(ctxt_pP, rlc_p),
|
||||
data_req.data.nb_elements);
|
||||
}
|
||||
data_req.ue_id_type_indicator = 0;
|
||||
|
||||
return data_req;
|
||||
}
|
||||
|
||||
@@ -582,6 +582,7 @@ rlc_um_mac_data_request (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP,cons
|
||||
} /* while (tb_p != NULL) */
|
||||
} /* if (data_req.data.nb_elements > 0) */
|
||||
|
||||
data_req.buffer_occupancy_in_pdus = 0;
|
||||
return data_req;
|
||||
}
|
||||
|
||||
|
||||
@@ -1038,6 +1038,8 @@ rlc_um_receive_process_dar (
|
||||
sn = pdu_pP->b1 & 0x1F;
|
||||
} else {
|
||||
free_mem_block(pdu_mem_pP, __func__);
|
||||
pdu_mem_pP = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
RLC_UM_MUTEX_LOCK(&rlc_pP->lock_dar_buffer, ctxt_pP, rlc_pP);
|
||||
|
||||
@@ -4517,6 +4517,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
|
||||
meas2.rsrpResult=&(rsrp_t);
|
||||
//&rsrp_va;
|
||||
meas2.rsrqResult=&(rsrq_t);
|
||||
meas2.ext1 = NULL;
|
||||
measresulteutra2->measResult=meas2;
|
||||
ASN_SEQUENCE_ADD(&measResultListEUTRA2->list,measresulteutra2);
|
||||
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2);
|
||||
@@ -4534,9 +4535,14 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
|
||||
if(enc_rval.encoded == -1) {
|
||||
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
free(measResultListEUTRA2);
|
||||
measResultListEUTRA2 = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(measResultListEUTRA2);
|
||||
measResultListEUTRA2 = NULL;
|
||||
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
|
||||
@@ -2381,6 +2381,12 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co
|
||||
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_FAILED;
|
||||
ue_context_pP->ue_context.e_rab[i].xid = xid;
|
||||
e_rab_done++;
|
||||
free(DRB_pdcp_config->discardTimer);
|
||||
free(DRB_pdcp_config);
|
||||
free(DRB_rlc_config);
|
||||
free(DRB_config->logicalChannelIdentity);
|
||||
free(DRB_config->eps_BearerIdentity);
|
||||
free(DRB_config);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3542,6 +3548,21 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
|
||||
free(Sparams);
|
||||
Sparams = NULL;
|
||||
|
||||
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP);
|
||||
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = NULL;
|
||||
|
||||
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ);
|
||||
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = NULL;
|
||||
|
||||
free(quantityConfig->quantityConfigEUTRA);
|
||||
quantityConfig->quantityConfigEUTRA = NULL;
|
||||
|
||||
free(quantityConfig);
|
||||
quantityConfig = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -5628,6 +5649,24 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
|
||||
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ);
|
||||
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = NULL;
|
||||
|
||||
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP);
|
||||
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = NULL;
|
||||
|
||||
free(quantityConfig->quantityConfigEUTRA);
|
||||
quantityConfig->quantityConfigEUTRA = NULL;
|
||||
|
||||
free(quantityConfig);
|
||||
quantityConfig = NULL;
|
||||
|
||||
free(securityConfigHO);
|
||||
securityConfigHO = NULL;
|
||||
|
||||
free(Sparams);
|
||||
Sparams = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -5771,6 +5810,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
/* CDRX: activated if ack was expected */
|
||||
int UE_id_mac = find_UE_id(ctxt_pP->module_id, ue_context_pP->ue_context.rnti);
|
||||
if (UE_id_mac == -1){
|
||||
LOG_E(RRC,PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_RRCConnectionReconfigurationComplete without UE_id(MAC) rnti %x, let's return\n",PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ue_context_pP->ue_context.rnti);
|
||||
return;
|
||||
}
|
||||
UE_sched_ctrl *UE_scheduling_control = &(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id_mac]);
|
||||
|
||||
if (UE_scheduling_control->cdrx_waiting_ack == TRUE) {
|
||||
@@ -6577,12 +6620,12 @@ rrc_eNB_decode_ccch(
|
||||
if (reestablish_rnti_map[i][0] == 0) {
|
||||
reestablish_rnti_map[i][0] = ctxt_pP->rnti;
|
||||
reestablish_rnti_map[i][1] = c_rnti;
|
||||
LOG_D(RRC, "reestablish_rnti_map[%d] [0] %x, [1] %x\n",
|
||||
i, reestablish_rnti_map[i][0], reestablish_rnti_map[i][1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(RRC, "reestablish_rnti_map[%d] [0] %x, [1] %x\n",
|
||||
i, reestablish_rnti_map[i][0], reestablish_rnti_map[i][1]);
|
||||
ue_context_p->ue_context.reestablishment_cause = rrcConnectionReestablishmentRequest->reestablishmentCause;
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept connection reestablishment request from UE physCellId %ld cause %ld\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -7221,13 +7264,12 @@ rrc_eNB_decode_dcch(
|
||||
// clear currentC-RNTI from map
|
||||
reestablish_rnti_map[i][0] = 0;
|
||||
reestablish_rnti_map[i][1] = 0;
|
||||
LOG_D(RRC, "reestablish_rnti_map[%d] [0] %x, [1] %x\n",
|
||||
i, reestablish_rnti_map[i][0], reestablish_rnti_map[i][1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(RRC, "reestablish_rnti_map[%d] [0] %x, [1] %x\n",
|
||||
i, reestablish_rnti_map[i][0], reestablish_rnti_map[i][1]);
|
||||
|
||||
if (!ue_context_p) {
|
||||
LOG_E(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" LTE_RRCConnectionReestablishmentComplete without UE context, falt\n",
|
||||
@@ -8401,6 +8443,9 @@ rrc_eNB_process_SidelinkUEInformation(
|
||||
|
||||
//generate RRC Reconfiguration
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(ctxt_pP, ue_context_pP, destinationInfoList, 0);
|
||||
|
||||
free(destinationInfoList);
|
||||
destinationInfoList = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8419,6 +8464,9 @@ rrc_eNB_process_SidelinkUEInformation(
|
||||
|
||||
//generate RRC Reconfiguration
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(ctxt_pP, ue_context_pP, destinationInfoList, 0);
|
||||
|
||||
free(destinationInfoList);
|
||||
destinationInfoList = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -8440,6 +8488,9 @@ rrc_eNB_process_SidelinkUEInformation(
|
||||
|
||||
//generate RRC Reconfiguration
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(ctxt_pP, ue_context_pP, destinationInfoList, 0);
|
||||
|
||||
free(destinationInfoList);
|
||||
destinationInfoList = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -8461,6 +8512,9 @@ rrc_eNB_process_SidelinkUEInformation(
|
||||
|
||||
//generate RRC Reconfiguration
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(ctxt_pP, ue_context_pP, destinationInfoList, 0);
|
||||
|
||||
free(destinationInfoList);
|
||||
destinationInfoList = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -8572,9 +8626,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
|
||||
|
||||
LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool( const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, LTE_SL_DestinationInfoList_r12_t *destinationInfoList ) {
|
||||
// for the moment, use scheduled resource allocation
|
||||
LTE_SL_CommConfig_r12_t *sl_CommConfig;
|
||||
LTE_SL_CommConfig_r12_t sl_CommConfig_r12;
|
||||
LTE_SL_CommConfig_r12_t *sl_CommConfig = &sl_CommConfig_r12;
|
||||
LTE_SL_CommResourcePool_r12_t *sc_CommTxConfig;
|
||||
sl_CommConfig = CALLOC(1, sizeof(struct LTE_SL_CommConfig_r12));
|
||||
memset(sl_CommConfig,0,sizeof(LTE_SL_CommConfig_r12_t));
|
||||
sl_CommConfig->commTxResources_r12 = CALLOC(1, sizeof(*sl_CommConfig->commTxResources_r12));
|
||||
sl_CommConfig->commTxResources_r12->present = LTE_SL_CommConfig_r12__commTxResources_r12_PR_setup;
|
||||
sl_CommConfig->commTxResources_r12->choice.setup.present = LTE_SL_CommConfig_r12__commTxResources_r12__setup_PR_scheduled_r12;
|
||||
|
||||
@@ -918,7 +918,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
rrc_data_req (
|
||||
&ctxt,
|
||||
srb_id,
|
||||
*rrc_eNB_mui++,
|
||||
(*rrc_eNB_mui)++,
|
||||
SDU_CONFIRM_NO,
|
||||
length,
|
||||
buffer,
|
||||
@@ -1634,6 +1634,8 @@ int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t *const ctxt_pP,
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done, e_rabs_failed);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
} else {
|
||||
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2031,6 +2033,8 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
} else {
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -218,6 +218,7 @@ error:
|
||||
|
||||
socket_link_t *new_link_udp_client(const char *server, int port){
|
||||
|
||||
int s = -1;
|
||||
socket_link_t *ret = NULL;
|
||||
ret = calloc(1, sizeof(socket_link_t));
|
||||
if (ret == NULL) {
|
||||
@@ -227,7 +228,6 @@ socket_link_t *new_link_udp_client(const char *server, int port){
|
||||
ret->socket_fd = -1;
|
||||
|
||||
struct sockaddr_in si_other;
|
||||
int s;
|
||||
socklen_t slen = sizeof(si_other);
|
||||
|
||||
if ( (s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1){
|
||||
@@ -254,8 +254,12 @@ socket_link_t *new_link_udp_client(const char *server, int port){
|
||||
return ret;
|
||||
error:
|
||||
if (ret != NULL) {
|
||||
close(ret->socket_fd);
|
||||
free(ret);
|
||||
ret = NULL;
|
||||
}
|
||||
if (s != -1) {
|
||||
close(s);
|
||||
s = -1;
|
||||
}
|
||||
LOG_E(MAC, "ERROR in new_link_udp_client (see above), returning NULL\n");
|
||||
return NULL;
|
||||
|
||||
@@ -785,6 +785,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
|
||||
if (ue_id != x2ap_find_id_from_id_source(&instance_p->id_manager, id_source)) {
|
||||
X2AP_WARN("incorrect/unknown X2AP IDs for UE (old ID %d new ID %d), ignoring handover response\n",
|
||||
id_source, id_target);
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -873,6 +874,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
|
||||
if (ue_id != x2ap_find_id_from_id_source(&instance_p->id_manager, id_source)) {
|
||||
X2AP_WARN("incorrect/unknown X2AP IDs for UE (old ID %d new ID %d), ignoring UE context release\n",
|
||||
id_source, id_target);
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -882,6 +884,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
|
||||
id_source,
|
||||
x2ap_id_get_id_target(&instance_p->id_manager, ue_id),
|
||||
id_target);
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -882,7 +882,7 @@ int gtpv1u_eNB_init(void) {
|
||||
* nw-gtpv1u stack.
|
||||
*/
|
||||
ulp.ulpReqCallback = gtpv1u_eNB_process_stack_req;
|
||||
|
||||
memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT));
|
||||
if ((rc = nwGtpv1uSetUlpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) {
|
||||
LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc);
|
||||
return -1;
|
||||
@@ -892,14 +892,14 @@ int gtpv1u_eNB_init(void) {
|
||||
* We provide a wrapper to UDP task.
|
||||
*/
|
||||
udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg;
|
||||
|
||||
memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT));
|
||||
if ((rc = nwGtpv1uSetUdpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) {
|
||||
LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
log.logReqCallback = gtpv1u_eNB_log_request;
|
||||
|
||||
memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT));
|
||||
if ((rc = nwGtpv1uSetLogMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) {
|
||||
LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc);
|
||||
return -1;
|
||||
|
||||
@@ -125,6 +125,7 @@ void* device_open(int type, const char* devpath, const char* params)
|
||||
if (stty_set(fd, params) != RETURNok) {
|
||||
device_close(devid);
|
||||
devid = NULL;
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,6 +221,8 @@ void* socket_udp_open(int type, const char* host, const char* port)
|
||||
sid->type = type;
|
||||
sid->port = atoi (port);
|
||||
sid->fd = sfd;
|
||||
} else {
|
||||
close (sfd);
|
||||
}
|
||||
|
||||
return sid;
|
||||
|
||||
@@ -276,7 +276,7 @@ int user_api_set_data(user_api_id_t *user_api_id, char *message)
|
||||
|
||||
memset(user_api_id->recv_buffer, 0, USER_API_RECV_BUFFER_SIZE);
|
||||
|
||||
strncpy(user_api_id->recv_buffer, message, USER_API_RECV_BUFFER_SIZE);
|
||||
strncpy(user_api_id->recv_buffer, message, USER_API_RECV_BUFFER_SIZE - 1);
|
||||
rbytes = strlen(user_api_id->recv_buffer);
|
||||
|
||||
LOG_TRACE(INFO, "USR-API - %d bytes write", rbytes);
|
||||
|
||||
@@ -268,9 +268,9 @@ int usim_api_authenticate_test(usim_data_t *usim_data,
|
||||
printf("usim_data->usim_sqn_data.sqn_ms %p\n", usim_data->usim_sqn_data.sqn_ms);
|
||||
for (i = 0; i < USIM_API_SQNMS_SIZE; i++) {
|
||||
//#warning "LG:BUG HERE TODO"
|
||||
printf("i %d: ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]);
|
||||
sqn_ms[USIM_API_SQNMS_SIZE - i] =
|
||||
((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i];
|
||||
printf("i %d: ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - 1 - i] %d\n",i, ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - 1 - i]);
|
||||
sqn_ms[USIM_API_SQNMS_SIZE - 1 - i] =
|
||||
((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - 1 - i];
|
||||
}
|
||||
|
||||
u8 sqnms[USIM_API_SQNMS_SIZE];
|
||||
@@ -409,7 +409,7 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co
|
||||
|
||||
//#define USIM_API_SQN_MS_SIZE 3
|
||||
printf("usim_data->usim_sqn.sqn_ms %p\n",usim_data->usim_sqn_data.sqn_ms);
|
||||
for (i = 0; i < USIM_API_SQNMS_SIZE; i++) {
|
||||
for (i = 1; i <= USIM_API_SQNMS_SIZE; i++) {
|
||||
//#warning "LG:BUG HERE TODO"
|
||||
printf("i %d: ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]);
|
||||
sqn_ms[USIM_API_SQNMS_SIZE - i] =
|
||||
|
||||
@@ -437,6 +437,7 @@ static int _emm_as_data_ind(nas_user_t *user, const emm_as_data_t *msg, int *emm
|
||||
if (bytes < 0) {
|
||||
/* Failed to decrypt the message */
|
||||
*emm_cause = EMM_CAUSE_PROTOCOL_ERROR;
|
||||
free(plain_msg);
|
||||
LOG_FUNC_RETURN (bytes);
|
||||
} else if (header.protocol_discriminator ==
|
||||
EPS_MOBILITY_MANAGEMENT_MESSAGE) {
|
||||
|
||||
@@ -195,6 +195,8 @@ int esm_proc_eps_bearer_context_deactivate_request(nas_user_t *user, int ebi, in
|
||||
int pid, bid;
|
||||
int rc = RETURNok;
|
||||
esm_data_t *esm_data = user->esm_data;
|
||||
bid = 0;
|
||||
pid = 0;
|
||||
|
||||
LOG_TRACE(INFO, "ESM-PROC - EPS bearer context deactivation "
|
||||
"requested by the network (ebi=%d)", ebi);
|
||||
|
||||
@@ -1212,6 +1212,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
||||
} else {
|
||||
/* invalid paging_p->cnDomain */
|
||||
S1AP_ERROR("[SCTP %d] Received Paging : cnDomain(%ld) is unknown\n", assoc_id, ie->value.choice.CNDomain);
|
||||
itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
@@ -1342,6 +1343,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
||||
S1AP_E_RAB_MODIFY_RESP(message_p).nb_of_e_rabs_failed = nb_of_e_rabs_failed;
|
||||
s1ap_eNB_e_rab_modify_resp(mme_desc_p->s1ap_eNB_instance->instance,
|
||||
&S1AP_E_RAB_MODIFY_RESP(message_p));
|
||||
itti_free(TASK_RRC_ENB,message_p);
|
||||
message_p = NULL;
|
||||
return -1;
|
||||
}
|
||||
@@ -1543,6 +1545,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
|
||||
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
|
||||
"existing UE context 0x%06lx\n", assoc_id,
|
||||
ie->value.choice.ENB_UE_S1AP_ID);
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -580,6 +580,7 @@ sctp_handle_new_association_req(
|
||||
addr6.sin6_family = AF_INET6;
|
||||
addr6.sin6_addr = in6addr_any;
|
||||
addr6.sin6_port = htons(sctp_new_association_req_p->port);
|
||||
addr6.sin6_flowinfo = 0;
|
||||
|
||||
if (bind(sd, (struct sockaddr*)&addr6, sizeof(addr6)) < 0) {
|
||||
SCTP_ERROR("Failed to bind the socket to address any (v4/v6): %s\n",
|
||||
@@ -763,6 +764,10 @@ static int sctp_create_new_listener(
|
||||
if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &event,
|
||||
sizeof(struct sctp_event_subscribe)) < 0) {
|
||||
SCTP_ERROR("setsockopt: %s:%d\n", strerror(errno), errno);
|
||||
if (sd != -1) {
|
||||
close(sd);
|
||||
sd = -1;
|
||||
}
|
||||
free(addr);
|
||||
return -1;
|
||||
}
|
||||
@@ -795,11 +800,15 @@ static int sctp_create_new_listener(
|
||||
|
||||
if (sctp_bindx(sd, addr, used_addresses, SCTP_BINDX_ADD_ADDR) != 0) {
|
||||
SCTP_ERROR("sctp_bindx: %s:%d\n", strerror(errno), errno);
|
||||
free(sctp_cnx);
|
||||
sctp_cnx = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (listen(sd, 5) < 0) {
|
||||
SCTP_ERROR("listen: %s:%d\n", strerror(errno), errno);
|
||||
free(sctp_cnx);
|
||||
sctp_cnx = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -818,6 +827,16 @@ err:
|
||||
sd = -1;
|
||||
}
|
||||
|
||||
if (sctp_cnx != NULL) {
|
||||
free(sctp_cnx);
|
||||
sctp_cnx = NULL;
|
||||
}
|
||||
|
||||
if (addr != NULL) {
|
||||
free(addr);
|
||||
addr = NULL;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ do { \
|
||||
do { \
|
||||
(bitstring)->size=2; \
|
||||
(bitstring)->bits_unused=0; \
|
||||
(bitstring)->buf=calloc (1, sizeof (uint8_t)); \
|
||||
(bitstring)->buf=calloc (2, sizeof (uint8_t)); \
|
||||
(bitstring)->buf[0] = (encralg) >> 8; \
|
||||
(bitstring)->buf[1] = (encralg); \
|
||||
}while(0)
|
||||
|
||||
@@ -501,6 +501,7 @@ int eth_set_dev_conf_raw(openair0_device *device) {
|
||||
perror("ETHERNET: ");
|
||||
exit(0);
|
||||
}
|
||||
free(msg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -532,7 +533,8 @@ int eth_set_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
perror("ETHERNET: ");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
free(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -590,5 +592,6 @@ int eth_get_dev_conf_raw_IF4p5(openair0_device *device) {
|
||||
//device->openair0_cfg=(openair0_config_t *)(msg + MAC_HEADER_SIZE_BYTES);
|
||||
printf("[%s] binding mod to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"),eth->ehd.ether_shost[0],eth->ehd.ether_shost[1],eth->ehd.ether_shost[2],eth->ehd.ether_shost[3],eth->ehd.ether_shost[4],eth->ehd.ether_shost[5],eth->ehd.ether_dhost[0],eth->ehd.ether_dhost[1],eth->ehd.ether_dhost[2],eth->ehd.ether_dhost[3],eth->ehd.ether_dhost[4],eth->ehd.ether_dhost[5]);
|
||||
|
||||
free(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user