diff --git a/src/smf/gn-build.c b/src/smf/gn-build.c index a064d3bca..0f8de74fe 100644 --- a/src/smf/gn-build.c +++ b/src/smf/gn-build.c @@ -282,7 +282,6 @@ ogs_pkbuf_t *smf_gn_build_create_pdp_context_response( gtp1_message.h.type = type; return ogs_gtp1_build_msg(>p1_message); - return NULL; } ogs_pkbuf_t *smf_gn_build_delete_pdp_context_response( diff --git a/src/smf/gsm-sm.c b/src/smf/gsm-sm.c index 7433ad16f..735de066f 100644 --- a/src/smf/gsm-sm.c +++ b/src/smf/gsm-sm.c @@ -638,6 +638,7 @@ void smf_gsm_state_wait_pfcp_establishment(ogs_fsm_t *s, smf_event_t *e) ogs_pfcp_xact_t *pfcp_xact = NULL; ogs_pfcp_message_t *pfcp_message = NULL; + int rv; ogs_assert(s); ogs_assert(e); @@ -672,16 +673,21 @@ void smf_gsm_state_wait_pfcp_establishment(ogs_fsm_t *s, smf_event_t *e) } switch (gtp_xact->gtp_version) { case 1: - ogs_assert(OGS_OK == - smf_gtp1_send_create_pdp_context_response( - sess, gtp_xact)); + rv = smf_gtp1_send_create_pdp_context_response(sess, gtp_xact); break; case 2: - ogs_assert(OGS_OK == - smf_gtp2_send_create_session_response( - sess, gtp_xact)); + rv = smf_gtp2_send_create_session_response(sess, gtp_xact); + break; + default: + rv = OGS_ERROR; break; } + /* If no CreatePDPCtxResp can be sent, then tear down the session: */ + if (rv != OGS_OK) { + OGS_FSM_TRAN(s, &smf_gsm_state_wait_pfcp_deletion); + return; + } + if (sess->gtp_rat_type == OGS_GTP2_RAT_TYPE_WLAN) { /* * TS23.214 @@ -1366,14 +1372,12 @@ test_can_proceed: */ switch (e->gtp_xact->gtp_version) { case 1: - ogs_assert(OGS_OK == - smf_gtp1_send_delete_pdp_context_response( - sess, e->gtp_xact)); + smf_gtp1_send_delete_pdp_context_response( + sess, e->gtp_xact); break; case 2: - ogs_assert(OGS_OK == - smf_gtp2_send_delete_session_response( - sess, e->gtp_xact)); + smf_gtp2_send_delete_session_response( + sess, e->gtp_xact); break; } } else {