[SMF] Check if session has been removed already between different events

This fix is needed to prevent SMF crash in case that one of the
neighbouring NF (AMF) crashed in the middle of the procedure.
This commit is contained in:
Bostjan Meglic 2023-01-12 10:12:03 +00:00 committed by Sukchan Lee
parent 200414ccca
commit bc3b27339e
1 changed files with 12 additions and 2 deletions

View File

@ -928,7 +928,12 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
}
ogs_assert(sess);
ogs_assert(OGS_FSM_STATE(&sess->sm));
sess = smf_sess_cycle(sess);
if (!sess) {
ogs_error("Session has already been removed");
ogs_pkbuf_free(pkbuf);
break;
}
e->nas.message = &nas_message;
ogs_fsm_dispatch(&sess->sm, e);
@ -946,7 +951,12 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
ogs_assert(e->ngap.type);
ogs_assert(sess);
ogs_assert(OGS_FSM_STATE(&sess->sm));
sess = smf_sess_cycle(sess);
if (!sess) {
ogs_error("Session has already been removed");
ogs_pkbuf_free(pkbuf);
break;
}
ogs_fsm_dispatch(&sess->sm, e);