From d21e9aa5e0db5930bc2d47b6eb29bf9fe591a23a Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Wed, 3 Aug 2022 14:13:35 +0900 Subject: [PATCH] [PFCP] Revert Changes 5e18b2b --- src/smf/n4-handler.c | 7 ++++++- src/smf/pfcp-sm.c | 30 ++---------------------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/smf/n4-handler.c b/src/smf/n4-handler.c index 3c3d251b6..7a2ebc4c4 100644 --- a/src/smf/n4-handler.c +++ b/src/smf/n4-handler.c @@ -1098,7 +1098,6 @@ void smf_n4_handle_session_report_request( uint16_t pdr_id = 0; unsigned int i; - ogs_assert(sess); ogs_assert(pfcp_xact); ogs_assert(pfcp_req); @@ -1106,6 +1105,11 @@ void smf_n4_handle_session_report_request( cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; + if (!sess) { + ogs_warn("No Context"); + cause_value = OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND; + } + if (pfcp_req->report_type.presence == 0) { ogs_error("No Report Type"); cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING; @@ -1118,6 +1122,7 @@ void smf_n4_handle_session_report_request( return; } + ogs_assert(sess); report_type.value = pfcp_req->report_type.u8; if (report_type.downlink_data_report) { diff --git a/src/smf/pfcp-sm.c b/src/smf/pfcp-sm.c index 07f48b45d..32da6115b 100644 --- a/src/smf/pfcp-sm.c +++ b/src/smf/pfcp-sm.c @@ -222,19 +222,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e) case OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE: if (!message->h.seid_presence) ogs_error("No SEID"); - if (!sess) { - ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; - ogs_assert(gtp_xact); - if (gtp_xact->gtp_version == 1) - ogs_gtp1_send_error_message(gtp_xact, 0, - OGS_GTP1_CREATE_PDP_CONTEXT_RESPONSE_TYPE, - OGS_GTP1_CAUSE_CONTEXT_NOT_FOUND); - else - ogs_gtp2_send_error_message(gtp_xact, 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, - OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); - break; - } + ogs_assert(sess); ogs_fsm_dispatch(&sess->sm, e); break; @@ -253,21 +241,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e) case OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE: if (!message->h.seid_presence) ogs_error("No SEID"); - if (!sess) { - ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; - if (!gtp_xact) - break; - if (gtp_xact->gtp_version == 1) - ogs_gtp1_send_error_message(gtp_xact, 0, - OGS_GTP1_CREATE_PDP_CONTEXT_RESPONSE_TYPE, - OGS_GTP1_CAUSE_CONTEXT_NOT_FOUND); - else - ogs_gtp2_send_error_message(gtp_xact, 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, - OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); - break; - } - + ogs_assert(sess); ogs_fsm_dispatch(&sess->sm, e); break;