Commit 31797221 authored by Konstantinos Alexandris's avatar Konstantinos Alexandris Committed by Cedric Roux

x2: bug fixes

- free correctly in rrc_eNB_free_mem_UE_context
- check for existence of ue_context.handover_info in rrc_enb_process_itti_msg
- check return value sctp_peeloff in sctp_handle_new_association_req_multi
  and exit in case of failure
parent 52a52eef
...@@ -2043,7 +2043,9 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2043,7 +2043,9 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) { if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1; X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 0;
} else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) { } else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 0;
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 1; X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 1;
} else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) { } else if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1; X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
......
...@@ -781,7 +781,8 @@ rrc_eNB_free_mem_UE_context( ...@@ -781,7 +781,8 @@ rrc_eNB_free_mem_UE_context(
ue_context_pP->ue_context.measGapConfig = NULL; ue_context_pP->ue_context.measGapConfig = NULL;
}*/ }*/
if (ue_context_pP->ue_context.handover_info) { if (ue_context_pP->ue_context.handover_info) {
ASN_STRUCT_FREE(asn_DEF_LTE_Handover, ue_context_pP->ue_context.handover_info); /* TODO: be sure free is enough here (check memory leaks) */
free(ue_context_pP->ue_context.handover_info);
ue_context_pP->ue_context.handover_info = NULL; ue_context_pP->ue_context.handover_info = NULL;
} }
...@@ -8319,19 +8320,17 @@ void *rrc_enb_process_itti_msg(void *notUsed) { ...@@ -8319,19 +8320,17 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance); rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance);
break; break;
case GTPV1U_ENB_DELETE_TUNNEL_RESP: case GTPV1U_ENB_DELETE_TUNNEL_RESP: {
rrc_eNB_ue_context_t *ue = rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti);
/* Nothing to do. Apparently everything is done in S1AP processing */ if (ue != NULL
//LOG_I(RRC, "[eNB %d] Received message %s, not processed because procedure not synched\n", && ue->ue_context.ue_release_timer_rrc > 0
//instance, msg_name_p); && (ue->ue_context.handover_info == NULL || ue->ue_context.handover_info->state != HO_RELEASE)) {
if (rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti) ue->ue_context.ue_release_timer_rrc = ue->ue_context.ue_release_timer_thres_rrc;
&& rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc > 0
&& rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.handover_info->state != HO_RELEASE) {
rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_rrc =
rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti)->ue_context.ue_release_timer_thres_rrc;
} }
break; break;
}
case S1AP_PATH_SWITCH_REQ_ACK: case S1AP_PATH_SWITCH_REQ_ACK:
LOG_I(RRC, "[eNB %d] received path switch ack %s\n", instance, msg_name_p); LOG_I(RRC, "[eNB %d] received path switch ack %s\n", instance, msg_name_p);
......
...@@ -324,7 +324,12 @@ sctp_handle_new_association_req_multi( ...@@ -324,7 +324,12 @@ sctp_handle_new_association_req_multi(
} }
} }
ns = sctp_peeloff(sd,assoc_id); ns = sctp_peeloff(sd, assoc_id);
if (ns == -1) {
perror("sctp_peeloff");
printf("sctp_peeloff: sd=%d assoc_id=%d\n", sd, assoc_id);
exit(1);
}
sctp_cnx = calloc(1, sizeof(*sctp_cnx)); sctp_cnx = calloc(1, sizeof(*sctp_cnx));
......
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