[SMF] Avoid crash if Create{Session,PdpContext}Resp fails to be sent (#1566)
* [SMF] Gn: Drop unreachable return line * [SMF] Avoid crash if Create{Session,PdpContext}Resp fails to be sent Crash spotted in a running open5gs-smfd process, triggered by: ERROR: ogs_gtp_sendto() failed (1:Operation not permitted) (../lib/gtp/path.c:119) ERROR: ogs_gtp_xact_commit: Expectation `rv == OGS_OK' failed. (../lib/gtp/xact.c:730) ERROR: smf_gtp2_send_create_session_response: Expectation `rv == OGS_OK' failed. (../src/smf/gtp-path.c:451) FATAL: smf_gsm_state_wait_pfcp_establishment: Assertion `OGS_OK == smf_gtp2_send_create_session_response( sess, gtp_xact)' failed. (../src/smf/gsm-sm.c:676) * [SMF] Avoid crash if Delete{Sesson,PdpContext}Resp fails to be sent Let's simply continuing with release of the session, there's not much we can do about it. Peer will eventually realize the conn is no longer there.
This commit is contained in:
parent
c2bda0b576
commit
e1e8018919
|
@ -282,7 +282,6 @@ ogs_pkbuf_t *smf_gn_build_create_pdp_context_response(
|
||||||
|
|
||||||
gtp1_message.h.type = type;
|
gtp1_message.h.type = type;
|
||||||
return ogs_gtp1_build_msg(>p1_message);
|
return ogs_gtp1_build_msg(>p1_message);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ogs_pkbuf_t *smf_gn_build_delete_pdp_context_response(
|
ogs_pkbuf_t *smf_gn_build_delete_pdp_context_response(
|
||||||
|
|
|
@ -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_xact_t *pfcp_xact = NULL;
|
||||||
ogs_pfcp_message_t *pfcp_message = NULL;
|
ogs_pfcp_message_t *pfcp_message = NULL;
|
||||||
|
int rv;
|
||||||
|
|
||||||
ogs_assert(s);
|
ogs_assert(s);
|
||||||
ogs_assert(e);
|
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) {
|
switch (gtp_xact->gtp_version) {
|
||||||
case 1:
|
case 1:
|
||||||
ogs_assert(OGS_OK ==
|
rv = smf_gtp1_send_create_pdp_context_response(sess, gtp_xact);
|
||||||
smf_gtp1_send_create_pdp_context_response(
|
|
||||||
sess, gtp_xact));
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ogs_assert(OGS_OK ==
|
rv = smf_gtp2_send_create_session_response(sess, gtp_xact);
|
||||||
smf_gtp2_send_create_session_response(
|
break;
|
||||||
sess, gtp_xact));
|
default:
|
||||||
|
rv = OGS_ERROR;
|
||||||
break;
|
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) {
|
if (sess->gtp_rat_type == OGS_GTP2_RAT_TYPE_WLAN) {
|
||||||
/*
|
/*
|
||||||
* TS23.214
|
* TS23.214
|
||||||
|
@ -1366,14 +1372,12 @@ test_can_proceed:
|
||||||
*/
|
*/
|
||||||
switch (e->gtp_xact->gtp_version) {
|
switch (e->gtp_xact->gtp_version) {
|
||||||
case 1:
|
case 1:
|
||||||
ogs_assert(OGS_OK ==
|
smf_gtp1_send_delete_pdp_context_response(
|
||||||
smf_gtp1_send_delete_pdp_context_response(
|
sess, e->gtp_xact);
|
||||||
sess, e->gtp_xact));
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ogs_assert(OGS_OK ==
|
smf_gtp2_send_delete_session_response(
|
||||||
smf_gtp2_send_delete_session_response(
|
sess, e->gtp_xact);
|
||||||
sess, e->gtp_xact));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue