Change in osmo-sgsn[master]: gprs_ranap.c: Clean up code path releasing IU conn

pespin gerrit-no-reply at lists.osmocom.org
Wed Apr 14 15:24:08 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/23748 )

Change subject: gprs_ranap.c: Clean up code path releasing IU conn
......................................................................

gprs_ranap.c: Clean up code path releasing IU conn

Let's always send the event to the FSM and keep logic of whether it's a
good event to sent or not inside the FSM, not in the caller.
The logic is kept the same: if the event is not expected (not handled),
keep forcing free of the IU connection.
In theory this should never happen since only a PMM in Connected state
should have a established connection (hence only a PMM in Connected
state can have it released). In any case let's keep the safety check,
but let the FSM receive the event and log an error about unexpected
event, which is more interesting from debug point of view.

While at it, clean up the related logging line: There's no need to print
the imsi explicitly, since LOGMMCTXP already does it. Furthermore, print
the exact low level event which triggered the code path.

Related: SYS#5389
Change-Id: I45017562ea7f27c2248b7de56f99ce7ca88e89b2
---
M src/sgsn/gprs_ranap.c
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  lynxis lazus: Looks good to me, approved



diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index 2d2d3aa..e8addd7 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -134,10 +134,9 @@
 		/* fall thru */
 	case RANAP_IU_EVENT_LINK_INVALIDATED:
 		/* Clean up ranap_ue_conn_ctx here */
-		LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
-		if (mm->iu.mm_state_fsm->state == ST_PMM_CONNECTED)
-			osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);
-		else
+		LOGMMCTXP(LOGL_INFO, mm, "IU release (cause=%s)\n", ranap_iu_event_type_str(type));
+		rc = osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);
+		if (rc < 0)
 			sgsn_ranap_iu_free(mm);
 
 		/* TODO: move this into FSM */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/23748
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I45017562ea7f27c2248b7de56f99ce7ca88e89b2
Gerrit-Change-Number: 23748
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210414/ca9d15b3/attachment.htm>


More information about the gerrit-log mailing list