Skip to content

Commit

Permalink
[smf][sgwc] minor checks and error-handling fixes (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencersevilla committed Jan 24, 2024
1 parent 240d821 commit 5494612
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/sgwc/pfcp-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ static void sess_timeout(ogs_pfcp_xact_t *pfcp_xact, void *data)
ogs_assert(sess);

s11_xact = pfcp_xact->assoc_xact;
ogs_assert(s11_xact);

if (!s11_xact) {
ogs_error("sess_timeout: No s11 context");
return;
}

switch (s11_xact->gtp_version) {
case 1:
Expand Down
6 changes: 5 additions & 1 deletion src/sgwc/s5c-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ void sgwc_s5c_handle_create_session_response(
********************/
ogs_assert(s5c_xact);
s11_xact = s5c_xact->assoc_xact;
ogs_assert(s11_xact);

rv = ogs_gtp_xact_commit(s5c_xact);
ogs_expect(rv == OGS_OK);

if (!s11_xact) {
ogs_error("No associated s11_xact!");
return;
}

/************************
* Getting Cause Value
************************/
Expand Down
7 changes: 6 additions & 1 deletion src/sgwc/sxa-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,14 @@ void sgwc_sxa_handle_session_establishment_response(
return sgwc_sxa_handle_session_reestablishment(sess, pfcp_xact, pfcp_rsp);
}

if (!recv_message) {
ogs_error("recv_message is nil! Aborting...");
ogs_pfcp_xact_commit(pfcp_xact);
return;
}

ogs_assert(pfcp_xact);
ogs_assert(pfcp_rsp);

ogs_assert(recv_message);

create_session_request = &recv_message->create_session_request;
Expand Down

0 comments on commit 5494612

Please sign in to comment.