From af1f8d4f4abb88bb94c8af19b2f9bb8275d368e7 Mon Sep 17 00:00:00 2001 From: mitmitmitm Date: Wed, 31 Aug 2022 10:59:05 +0200 Subject: [PATCH] [SMF] Handle upCnxState=ACTIVATING by replying with 200 instead of 204 According to TS 29.502 5.2.2.3.2.2., we should reply with a 200 response including the upCnxState attribute. --- src/smf/context.h | 2 ++ src/smf/n4-handler.c | 9 ++++++++- src/smf/nsmf-handler.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/smf/context.h b/src/smf/context.h index 31cbdb4c7..f6d3f1312 100644 --- a/src/smf/context.h +++ b/src/smf/context.h @@ -270,6 +270,8 @@ typedef struct smf_sess_s { * of [POST] /npcf-smpolocycontrol/v1/policies */ char *policy_association_id; + OpenAPI_up_cnx_state_e up_cnx_state; + /* PLMN ID & NID */ ogs_plmn_id_t plmn_id; diff --git a/src/smf/n4-handler.c b/src/smf/n4-handler.c index e9de2c401..96d9fd468 100644 --- a/src/smf/n4-handler.c +++ b/src/smf/n4-handler.c @@ -400,7 +400,14 @@ void smf_5gc_n4_handle_session_modification_response( } else { sess->paging.ue_requested_pdu_session_establishment_done = true; - ogs_assert(true == ogs_sbi_send_http_status_no_content(stream)); + + 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)); + } } } else if (flags & OGS_PFCP_MODIFY_DEACTIVATE) { diff --git a/src/smf/nsmf-handler.c b/src/smf/nsmf-handler.c index fee51520a..9630b11f0 100644 --- a/src/smf/nsmf-handler.c +++ b/src/smf/nsmf-handler.c @@ -432,6 +432,7 @@ 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;