- Fixed handling of non success result for S1AP/SCTP new association
- Handled not connected state in SCTP when recvmsg returns -1 git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4416 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -89,8 +89,8 @@ void *mme_app_thread(void *args)
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case TERMINATE_MESSAGE: {
|
case TERMINATE_MESSAGE: {
|
||||||
/* Termination message received -> release any data allocated */
|
/* Termination message received TODO -> release any data allocated */
|
||||||
|
itti_exit_task();
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
MME_APP_DEBUG("Unkwnon message ID %d:%s\n",
|
MME_APP_DEBUG("Unkwnon message ID %d:%s\n",
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
|||||||
sctp_new_association_resp->sctp_state,
|
sctp_new_association_resp->sctp_state,
|
||||||
instance,
|
instance,
|
||||||
sctp_new_association_resp->ulp_cnx_id);
|
sctp_new_association_resp->ulp_cnx_id);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update parameters */
|
/* Update parameters */
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#define SCTP_OUT_STREAMS (64)
|
#define SCTP_OUT_STREAMS (64)
|
||||||
#define SCTP_IN_STREAMS (64)
|
#define SCTP_IN_STREAMS (64)
|
||||||
#define SCTP_MAX_ATTEMPTS (5)
|
#define SCTP_MAX_ATTEMPTS (2)
|
||||||
#define SCTP_RECV_BUFFER_SIZE (1024)
|
#define SCTP_RECV_BUFFER_SIZE (1024)
|
||||||
|
|
||||||
#endif /* S1AP_ENB_DEFAULT_VALUES_H_ */
|
#endif /* S1AP_ENB_DEFAULT_VALUES_H_ */
|
||||||
|
|||||||
@@ -240,8 +240,12 @@ void sctp_handle_new_association_req(
|
|||||||
sctp_itti_send_association_resp(
|
sctp_itti_send_association_resp(
|
||||||
requestor, instance, -1, sctp_new_association_req_p->ulp_cnx_id,
|
requestor, instance, -1, sctp_new_association_req_p->ulp_cnx_id,
|
||||||
SCTP_STATE_UNREACHABLE, 0, 0);
|
SCTP_STATE_UNREACHABLE, 0, 0);
|
||||||
|
/* Add the socket to list of fd monitored by ITTI */
|
||||||
|
itti_unsubscribe_event_fd(TASK_SCTP, sd);
|
||||||
close(sd);
|
close(sd);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
SCTP_DEBUG("connectx in progress...\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -406,8 +410,23 @@ inline void sctp_eNB_read_from_socket(struct sctp_cnx_list_elm_s *sctp_cnx)
|
|||||||
(struct sockaddr *)&addr, &from_len,
|
(struct sockaddr *)&addr, &from_len,
|
||||||
&sinfo, &flags);
|
&sinfo, &flags);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
SCTP_DEBUG("An error occured during read\n");
|
if (errno == ENOTCONN) {
|
||||||
SCTP_ERROR("sctp_recvmsg: %s:%d\n", strerror(errno), errno);
|
itti_unsubscribe_event_fd(TASK_SCTP, sctp_cnx->sd);
|
||||||
|
|
||||||
|
sctp_itti_send_association_resp(
|
||||||
|
sctp_cnx->task_id, sctp_cnx->instance, -1,
|
||||||
|
sctp_cnx->cnx_id, SCTP_STATE_UNREACHABLE, 0, 0);
|
||||||
|
|
||||||
|
close(sctp_cnx->sd);
|
||||||
|
sctp_nb_cnx--;
|
||||||
|
free(sctp_cnx);
|
||||||
|
} else {
|
||||||
|
SCTP_DEBUG("An error occured during read\n");
|
||||||
|
SCTP_ERROR("sctp_recvmsg: %s:%d\n", strerror(errno), errno);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
} else if (n == 0) {
|
||||||
|
SCTP_DEBUG("return of sctp_recvmsg is 0...\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flags & MSG_NOTIFICATION) {
|
if (flags & MSG_NOTIFICATION) {
|
||||||
@@ -419,9 +438,19 @@ inline void sctp_eNB_read_from_socket(struct sctp_cnx_list_elm_s *sctp_cnx)
|
|||||||
|
|
||||||
/* Client deconnection */
|
/* Client deconnection */
|
||||||
if (SCTP_SHUTDOWN_EVENT == snp->sn_header.sn_type) {
|
if (SCTP_SHUTDOWN_EVENT == snp->sn_header.sn_type) {
|
||||||
DevMessage("Other peer has requested a com down -> not handled\n");
|
|
||||||
// return sctp_handle_com_down(snp->sn_shutdown_event.sse_assoc_id);
|
|
||||||
itti_unsubscribe_event_fd(TASK_SCTP, sctp_cnx->sd);
|
itti_unsubscribe_event_fd(TASK_SCTP, sctp_cnx->sd);
|
||||||
|
|
||||||
|
close(sctp_cnx->sd);
|
||||||
|
|
||||||
|
sctp_itti_send_association_resp(
|
||||||
|
sctp_cnx->task_id, sctp_cnx->instance, sctp_cnx->assoc_id,
|
||||||
|
sctp_cnx->cnx_id, SCTP_STATE_SHUTDOWN,
|
||||||
|
0, 0);
|
||||||
|
|
||||||
|
STAILQ_REMOVE(&sctp_cnx_list, sctp_cnx, sctp_cnx_list_elm_s, entries);
|
||||||
|
sctp_nb_cnx--;
|
||||||
|
|
||||||
|
free(sctp_cnx);
|
||||||
}
|
}
|
||||||
/* Association has changed. */
|
/* Association has changed. */
|
||||||
else if (SCTP_ASSOC_CHANGE == snp->sn_header.sn_type) {
|
else if (SCTP_ASSOC_CHANGE == snp->sn_header.sn_type) {
|
||||||
@@ -515,7 +544,8 @@ void *sctp_eNB_task(void *arg)
|
|||||||
|
|
||||||
/* Check if there is a packet to handle */
|
/* Check if there is a packet to handle */
|
||||||
if (received_msg != NULL) {
|
if (received_msg != NULL) {
|
||||||
switch (ITTI_MSG_ID(received_msg)) {
|
switch (ITTI_MSG_ID(received_msg))
|
||||||
|
{
|
||||||
case TERMINATE_MESSAGE:
|
case TERMINATE_MESSAGE:
|
||||||
itti_exit_task();
|
itti_exit_task();
|
||||||
break;
|
break;
|
||||||
@@ -530,8 +560,8 @@ void *sctp_eNB_task(void *arg)
|
|||||||
&received_msg->msg.sctp_data_req);
|
&received_msg->msg.sctp_data_req);
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
SCTP_ERROR("Received unhandled message with id %d\n",
|
SCTP_ERROR("Received unhandled message %d:%s\n",
|
||||||
ITTI_MSG_ID(received_msg));
|
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user