mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 04:53:37 +00:00
[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:
@@ -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(
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user