nsa: x2ap: hack: exit gNB if connection to eNB failed

Exit gNB if connection to eNB failed - to be modified if needed.

We may want to try to connect over and over again until we succeed
but the modifications to the code to get this behavior are complex.

Exit on error is a simple solution.
This commit is contained in:
Cedric Roux
2021-04-16 12:36:44 +02:00
parent 875e2906e5
commit c63abcd0f2
+12
View File
@@ -130,6 +130,18 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
DevAssert(x2ap_enb_data_p != NULL);
dump_trees();
/* gNB: exit if connection to eNB failed - to be modified if needed.
* We may want to try to connect over and over again until we succeed
* but the modifications to the code to get this behavior are complex.
* Exit on error is a simple solution that can be caught by a script
* for example.
*/
if (instance_p->cell_type == CELL_MACRO_GNB
&& sctp_new_association_resp->sctp_state == SCTP_STATE_UNREACHABLE) {
X2AP_ERROR("association with eNB failed, is it running? If no, run it first. If yes, check IP addresses in your configuration file.\n");
exit(1);
}
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
X2AP_WARN("Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
sctp_new_association_resp->sctp_state,