aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-04-14 12:42:00 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-04-14 12:42:02 +0200
commit922684f318802395f319fbc5f81badc9f63bd754 (patch)
tree884f7c02e962832b4e476a46d4e405cccc700004 /src
parent3caa7f6d97c3c7fec6535585b502d05ca04217b6 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/sgsn/gprs_ranap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index 2d2d3aa3..e8addd7e 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -134,10 +134,9 @@ int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type
/* 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 */