Commit 5bce383c authored by matzakos's avatar matzakos

Remove X2 data RB tree entry at eNB after receiving sctp shutdown event from gNB

-If the gNB crashes when the X2 connection is established with the eNB, an sctp shutdown event is received from the eNB. However the x2 data related with
the connection were not removed from the RB tree. Then if the gNB tried to reconnect, it made the eNB exit because the eNB had kept the previous data.
Now we remove the x2 data as soon as the sctp shutdown event is received so that the eNB does not exit anymore at the next connection attempts.
parent df645ef7
......@@ -116,6 +116,11 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
/* some sanity check - to be refined at some point */
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
X2AP_ERROR("x2ap_enb_data_p not NULL and sctp state not SCTP_STATE_ESTABLISHED, what to do?\n");
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN){
RB_REMOVE(x2ap_enb_map, &instance_p->x2ap_enb_head, x2ap_enb_data_p);
return;
}
exit(1);
}
......
......@@ -985,6 +985,7 @@ sctp_eNB_read_from_socket(
if (SCTP_SHUTDOWN_EVENT == snp->sn_header.sn_type) {
itti_unsubscribe_event_fd(TASK_SCTP, sctp_cnx->sd);
SCTP_DEBUG("Received SCTP SHUTDOWN EVENT\n");
close(sctp_cnx->sd);
sctp_itti_send_association_resp(
......
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