forked from acouzens/open5gs
Fixed the bug of SGW-C session deletion (#1825)
This commit is contained in:
parent
b151642fa1
commit
e3ba32c85d
|
@ -231,6 +231,7 @@ int sgwc_gtp_send_downlink_data_notification(
|
||||||
gtp_xact = ogs_gtp_xact_local_create(
|
gtp_xact = ogs_gtp_xact_local_create(
|
||||||
sgwc_ue->gnode, &h, pkbuf, bearer_timeout, bearer);
|
sgwc_ue->gnode, &h, pkbuf, bearer_timeout, bearer);
|
||||||
ogs_expect_or_return_val(gtp_xact, OGS_ERROR);
|
ogs_expect_or_return_val(gtp_xact, OGS_ERROR);
|
||||||
|
gtp_xact->local_teid = sgwc_ue->sgw_s11_teid;
|
||||||
|
|
||||||
rv = ogs_gtp_xact_commit(gtp_xact);
|
rv = ogs_gtp_xact_commit(gtp_xact);
|
||||||
ogs_expect(rv == OGS_OK);
|
ogs_expect(rv == OGS_OK);
|
||||||
|
|
|
@ -661,6 +661,7 @@ void sgwc_s11_handle_delete_session_request(
|
||||||
s5c_xact = ogs_gtp_xact_local_create(
|
s5c_xact = ogs_gtp_xact_local_create(
|
||||||
sess->gnode, &message->h, gtpbuf, gtp_sess_timeout, sess);
|
sess->gnode, &message->h, gtpbuf, gtp_sess_timeout, sess);
|
||||||
ogs_expect_or_return(s5c_xact);
|
ogs_expect_or_return(s5c_xact);
|
||||||
|
s5c_xact->local_teid = sess->sgw_s5c_teid;
|
||||||
|
|
||||||
ogs_gtp_xact_associate(s11_xact, s5c_xact);
|
ogs_gtp_xact_associate(s11_xact, s5c_xact);
|
||||||
|
|
||||||
|
|
|
@ -420,7 +420,6 @@ void sgwc_s5c_handle_delete_session_response(
|
||||||
ogs_pkbuf_t *gtpbuf, ogs_gtp2_message_t *message)
|
ogs_pkbuf_t *gtpbuf, ogs_gtp2_message_t *message)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
ogs_gtp2_cause_t *cause = NULL;
|
|
||||||
uint8_t cause_value;
|
uint8_t cause_value;
|
||||||
|
|
||||||
sgwc_ue_t *sgwc_ue = NULL;
|
sgwc_ue_t *sgwc_ue = NULL;
|
||||||
|
@ -466,37 +465,23 @@ void sgwc_s5c_handle_delete_session_response(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************
|
|
||||||
* Check Mandatory/Conditional IE Missing
|
|
||||||
*****************************************/
|
|
||||||
ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED);
|
|
||||||
|
|
||||||
if (rsp->cause.presence == 0) {
|
|
||||||
ogs_error("No Cause");
|
|
||||||
cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
|
||||||
ogs_gtp_send_error_message(
|
|
||||||
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
|
|
||||||
OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************
|
/********************
|
||||||
* Check Cause Value
|
* Check Cause Value
|
||||||
********************/
|
********************/
|
||||||
ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED);
|
ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED);
|
||||||
|
|
||||||
cause = rsp->cause.data;
|
if (rsp->cause.presence) {
|
||||||
ogs_assert(cause);
|
ogs_gtp2_cause_t *cause = rsp->cause.data;
|
||||||
cause_value = cause->value;
|
ogs_assert(cause);
|
||||||
|
|
||||||
|
cause_value = cause->value;
|
||||||
|
} else {
|
||||||
|
ogs_error("No Cause");
|
||||||
|
cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING;
|
||||||
|
}
|
||||||
|
|
||||||
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
||||||
ogs_error("GTP Cause [Value:%d]", cause_value);
|
ogs_error("GTP Cause [Value:%d] - Ignored", cause_value);
|
||||||
ogs_gtp_send_error_message(
|
|
||||||
s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
|
|
||||||
OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************
|
/********************
|
||||||
|
@ -725,6 +710,7 @@ void sgwc_s5c_handle_update_bearer_request(
|
||||||
s11_xact = ogs_gtp_xact_local_create(
|
s11_xact = ogs_gtp_xact_local_create(
|
||||||
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
|
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
|
||||||
ogs_expect_or_return(s11_xact);
|
ogs_expect_or_return(s11_xact);
|
||||||
|
s11_xact->local_teid = sgwc_ue->sgw_s11_teid;
|
||||||
|
|
||||||
ogs_gtp_xact_associate(s5c_xact, s11_xact);
|
ogs_gtp_xact_associate(s5c_xact, s11_xact);
|
||||||
} else {
|
} else {
|
||||||
|
@ -870,6 +856,7 @@ void sgwc_s5c_handle_delete_bearer_request(
|
||||||
s11_xact = ogs_gtp_xact_local_create(
|
s11_xact = ogs_gtp_xact_local_create(
|
||||||
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
|
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
|
||||||
ogs_expect_or_return(s11_xact);
|
ogs_expect_or_return(s11_xact);
|
||||||
|
s11_xact->local_teid = sgwc_ue->sgw_s11_teid;
|
||||||
|
|
||||||
ogs_gtp_xact_associate(s5c_xact, s11_xact);
|
ogs_gtp_xact_associate(s5c_xact, s11_xact);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -232,6 +232,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e)
|
||||||
|
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
ogs_gtp_xact_t *gtp_xact = xact->assoc_xact;
|
ogs_gtp_xact_t *gtp_xact = xact->assoc_xact;
|
||||||
|
ogs_error("No Session");
|
||||||
if (!gtp_xact) {
|
if (!gtp_xact) {
|
||||||
ogs_error("No associated GTP transaction");
|
ogs_error("No associated GTP transaction");
|
||||||
break;
|
break;
|
||||||
|
@ -266,6 +267,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e)
|
||||||
|
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
ogs_gtp_xact_t *gtp_xact = xact->assoc_xact;
|
ogs_gtp_xact_t *gtp_xact = xact->assoc_xact;
|
||||||
|
ogs_error("No Session");
|
||||||
if (!gtp_xact) {
|
if (!gtp_xact) {
|
||||||
ogs_error("No associated GTP transaction");
|
ogs_error("No associated GTP transaction");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -143,6 +143,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
|
||||||
OGS_SETUP_GTP_NODE(sess, smf_gnode->gnode);
|
OGS_SETUP_GTP_NODE(sess, smf_gnode->gnode);
|
||||||
}
|
}
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
|
ogs_error("No Session");
|
||||||
ogs_gtp2_send_error_message(gtp_xact, 0,
|
ogs_gtp2_send_error_message(gtp_xact, 0,
|
||||||
OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE,
|
OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE,
|
||||||
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
|
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
|
||||||
|
@ -152,9 +153,11 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
|
||||||
ogs_fsm_dispatch(&sess->sm, e);
|
ogs_fsm_dispatch(&sess->sm, e);
|
||||||
break;
|
break;
|
||||||
case OGS_GTP2_DELETE_SESSION_REQUEST_TYPE:
|
case OGS_GTP2_DELETE_SESSION_REQUEST_TYPE:
|
||||||
|
if (!gtp2_message.h.teid_presence) ogs_error("No TEID");
|
||||||
smf_metrics_inst_global_inc(SMF_METR_GLOB_CTR_S5C_RX_DELETESESSIONREQ);
|
smf_metrics_inst_global_inc(SMF_METR_GLOB_CTR_S5C_RX_DELETESESSIONREQ);
|
||||||
smf_metrics_inst_gtp_node_inc(smf_gnode->metrics, SMF_METR_GTP_NODE_CTR_S5C_RX_DELETESESSIONREQ);
|
smf_metrics_inst_gtp_node_inc(smf_gnode->metrics, SMF_METR_GTP_NODE_CTR_S5C_RX_DELETESESSIONREQ);
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
|
ogs_error("No Session");
|
||||||
ogs_gtp2_send_error_message(gtp_xact, 0,
|
ogs_gtp2_send_error_message(gtp_xact, 0,
|
||||||
OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE,
|
OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE,
|
||||||
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
|
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
|
||||||
|
@ -164,6 +167,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
|
||||||
ogs_fsm_dispatch(&sess->sm, e);
|
ogs_fsm_dispatch(&sess->sm, e);
|
||||||
break;
|
break;
|
||||||
case OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE:
|
case OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE:
|
||||||
|
if (!gtp2_message.h.teid_presence) ogs_error("No TEID");
|
||||||
smf_s5c_handle_modify_bearer_request(
|
smf_s5c_handle_modify_bearer_request(
|
||||||
sess, gtp_xact, recvbuf, >p2_message.modify_bearer_request);
|
sess, gtp_xact, recvbuf, >p2_message.modify_bearer_request);
|
||||||
break;
|
break;
|
||||||
|
@ -188,6 +192,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
|
||||||
ogs_fsm_dispatch(&sess->sm, e);
|
ogs_fsm_dispatch(&sess->sm, e);
|
||||||
break;
|
break;
|
||||||
case OGS_GTP2_BEARER_RESOURCE_COMMAND_TYPE:
|
case OGS_GTP2_BEARER_RESOURCE_COMMAND_TYPE:
|
||||||
|
if (!gtp2_message.h.teid_presence) ogs_error("No TEID");
|
||||||
smf_s5c_handle_bearer_resource_command(
|
smf_s5c_handle_bearer_resource_command(
|
||||||
sess, gtp_xact, >p2_message.bearer_resource_command);
|
sess, gtp_xact, >p2_message.bearer_resource_command);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue