<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/23748">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_ranap.c: Clean up code path releasing IU conn<br><br>Let's always send the event to the FSM and keep logic of whether it's a<br>good event to sent or not inside the FSM, not in the caller.<br>The logic is kept the same: if the event is not expected (not handled),<br>keep forcing free of the IU connection.<br>In theory this should never happen since only a PMM in Connected state<br>should have a established connection (hence only a PMM in Connected<br>state can have it released). In any case let's keep the safety check,<br>but let the FSM receive the event and log an error about unexpected<br>event, which is more interesting from debug point of view.<br><br>While at it, clean up the related logging line: There's no need to print<br>the imsi explicitly, since LOGMMCTXP already does it. Furthermore, print<br>the exact low level event which triggered the code path.<br><br>Related: SYS#5389<br>Change-Id: I45017562ea7f27c2248b7de56f99ce7ca88e89b2<br>---<br>M src/sgsn/gprs_ranap.c<br>1 file changed, 3 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/48/23748/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c</span><br><span>index 2d2d3aa..e8addd7 100644</span><br><span>--- a/src/sgsn/gprs_ranap.c</span><br><span>+++ b/src/sgsn/gprs_ranap.c</span><br><span>@@ -134,10 +134,9 @@</span><br><span>             /* fall thru */</span><br><span>      case RANAP_IU_EVENT_LINK_INVALIDATED:</span><br><span>                /* Clean up ranap_ue_conn_ctx here */</span><br><span style="color: hsl(0, 100%, 40%);">-           LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);</span><br><span style="color: hsl(0, 100%, 40%);">-            if (mm->iu.mm_state_fsm->state == ST_PMM_CONNECTED)</span><br><span style="color: hsl(0, 100%, 40%);">-                       osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);</span><br><span style="color: hsl(0, 100%, 40%);">-            else</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGMMCTXP(LOGL_INFO, mm, "IU release (cause=%s)\n", ranap_iu_event_type_str(type));</span><br><span style="color: hsl(120, 100%, 40%);">+         rc = osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+             if (rc < 0)</span><br><span>                       sgsn_ranap_iu_free(mm);</span><br><span> </span><br><span>          /* TODO: move this into FSM */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/23748">change 23748</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-sgsn/+/23748"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I45017562ea7f27c2248b7de56f99ce7ca88e89b2 </div>
<div style="display:none"> Gerrit-Change-Number: 23748 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>