From d87d61e851bffa175be00f08c02b749f08a0d7fa Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Sat, 3 Sep 2022 09:20:48 +0900 Subject: [PATCH] Follow-up on #1729 --- src/amf/nsmf-handler.c | 1 + src/smf/ngap-handler.c | 10 ++++++++++ src/smf/nsmf-handler.c | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/amf/nsmf-handler.c b/src/amf/nsmf-handler.c index 1d4acced4..58ca9b2f4 100644 --- a/src/amf/nsmf-handler.c +++ b/src/amf/nsmf-handler.c @@ -412,6 +412,7 @@ int amf_nsmf_pdusession_handle_update_sm_context( } } else { + SmContextUpdatedData = recvmsg->SmContextUpdatedData; if (state == AMF_UPDATE_SM_CONTEXT_ACTIVATED) { /* diff --git a/src/smf/ngap-handler.c b/src/smf/ngap-handler.c index f96ce849c..396adf10c 100644 --- a/src/smf/ngap-handler.c +++ b/src/smf/ngap-handler.c @@ -151,8 +151,18 @@ int ngap_handle_pdu_session_resource_setup_response_transfer( sess, stream, OGS_PFCP_MODIFY_DL_ONLY|OGS_PFCP_MODIFY_ACTIVATE, 0)); } else { +#if 0 /* Modified by pull request #1729 */ /* ACTIVATED Is NOT Included in RESPONSE */ ogs_assert(true == ogs_sbi_send_http_status_no_content(stream)); +#else + if (sess->up_cnx_state == OpenAPI_up_cnx_state_ACTIVATING) { + sess->up_cnx_state = OpenAPI_up_cnx_state_ACTIVATED; + smf_sbi_send_sm_context_updated_data_up_cnx_state( + sess, stream, OpenAPI_up_cnx_state_ACTIVATED); + } else { + ogs_assert(true == ogs_sbi_send_http_status_no_content(stream)); + } +#endif } rv = OGS_OK; diff --git a/src/smf/nsmf-handler.c b/src/smf/nsmf-handler.c index 9630b11f0..d8c1b9eef 100644 --- a/src/smf/nsmf-handler.c +++ b/src/smf/nsmf-handler.c @@ -350,6 +350,8 @@ bool smf_nsmf_handle_update_sm_context( } else if (SmContextUpdateData->up_cnx_state) { + sess->up_cnx_state = SmContextUpdateData->up_cnx_state; + if (SmContextUpdateData->up_cnx_state == OpenAPI_up_cnx_state_DEACTIVATED) { @@ -432,7 +434,6 @@ bool smf_nsmf_handle_update_sm_context( memset(&SmContextUpdatedData, 0, sizeof(SmContextUpdatedData)); SmContextUpdatedData.up_cnx_state = OpenAPI_up_cnx_state_ACTIVATING; - sess->up_cnx_state = OpenAPI_up_cnx_state_ACTIVATING; SmContextUpdatedData.n2_sm_info_type = OpenAPI_n2_sm_info_type_PDU_RES_SETUP_REQ; SmContextUpdatedData.n2_sm_info = &n2SmInfo;