From d095f18569e66b9c2230d04036884d048495f6f2 Mon Sep 17 00:00:00 2001 From: Spencer Sevilla Date: Tue, 20 Sep 2022 13:36:55 -0700 Subject: [PATCH] idempotent pfcp-session-delete --- src/sgwc/sxa-handler.c | 3 ++- src/sgwu/sxa-handler.c | 2 +- src/smf/n4-handler.c | 6 ++++-- src/smf/pfcp-sm.c | 2 ++ src/upf/n4-handler.c | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/sgwc/sxa-handler.c b/src/sgwc/sxa-handler.c index 59c61c7ddc..51f79dea67 100644 --- a/src/sgwc/sxa-handler.c +++ b/src/sgwc/sxa-handler.c @@ -1218,7 +1218,8 @@ void sgwc_sxa_handle_session_deletion_response( } if (pfcp_rsp->cause.presence) { - if (pfcp_rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { + if (pfcp_rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED && + pfcp_rsp->cause.u8 != OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND) { ogs_warn("PFCP Cause[%d] : Not Accepted", pfcp_rsp->cause.u8); cause_value = gtp_cause_from_pfcp(pfcp_rsp->cause.u8); } diff --git a/src/sgwu/sxa-handler.c b/src/sgwu/sxa-handler.c index b000626d64..03099b5a4e 100644 --- a/src/sgwu/sxa-handler.c +++ b/src/sgwu/sxa-handler.c @@ -396,7 +396,7 @@ void sgwu_sxa_handle_session_deletion_request( ogs_debug("Session Deletion Request"); if (!sess) { - ogs_error("No Context"); + ogs_warn("No Context"); ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); diff --git a/src/smf/n4-handler.c b/src/smf/n4-handler.c index 96d9fd468e..99f92c5efa 100644 --- a/src/smf/n4-handler.c +++ b/src/smf/n4-handler.c @@ -633,7 +633,8 @@ int smf_5gc_n4_handle_session_deletion_response( ogs_assert(sess); if (rsp->cause.presence) { - if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { + if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED && + rsp->cause.u8 != OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND) { ogs_warn("PFCP Cause [%d] : Not Accepted", rsp->cause.u8); status = sbi_status_from_pfcp(rsp->cause.u8); } @@ -1062,7 +1063,8 @@ uint8_t smf_epc_n4_handle_session_deletion_response( ogs_error("No Cause"); return OGS_PFCP_CAUSE_MANDATORY_IE_MISSING; } - if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { + if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED && + rsp->cause.u8 != OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND) { ogs_warn("PFCP Cause[%d] : Not Accepted", rsp->cause.u8); return rsp->cause.u8; } diff --git a/src/smf/pfcp-sm.c b/src/smf/pfcp-sm.c index de2fdd4a1d..76d9e8757b 100644 --- a/src/smf/pfcp-sm.c +++ b/src/smf/pfcp-sm.c @@ -257,6 +257,8 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e) if (!message->h.seid_presence) ogs_error("No SEID"); if (!sess) { + ogs_warn("No session associated with Session Deletion Response"); + ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; if (!gtp_xact) { ogs_error("No associated GTP transaction"); diff --git a/src/upf/n4-handler.c b/src/upf/n4-handler.c index cbfe63c4fc..5b0be6ff43 100644 --- a/src/upf/n4-handler.c +++ b/src/upf/n4-handler.c @@ -461,7 +461,7 @@ void upf_n4_handle_session_deletion_request( ogs_debug("Session Deletion Request"); if (!sess) { - ogs_error("No Context"); + ogs_warn("No Context"); ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0);