<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-iuh/+/23742">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ranap_iu_tx_release_free(): always trigger RANAP_IU_EVENT_IU_RELEASE as a result<br><br>This allows the SGSN always having feedback on the resolution of the<br>release, hence being able to stay in PMM CONNECTED state until the<br>resolution is received, then moving to PMM IDLE.<br><br>Related: SYS#5389<br>Change-Id: Iac822c74e56750dc40e94573eae0e20853ff68c0<br>---<br>M include/osmocom/ranap/iu_client.h<br>M src/iu_client.c<br>2 files changed, 13 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/42/23742/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h</span><br><span>index 24a5af9..5e946dd 100644</span><br><span>--- a/include/osmocom/ranap/iu_client.h</span><br><span>+++ b/include/osmocom/ranap/iu_client.h</span><br><span>@@ -75,9 +75,9 @@</span><br><span> int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi);</span><br><span> int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* transmit a Iu Release Command and free the ctx afterwards.</span><br><span style="color: hsl(0, 100%, 40%);">- * If a Release Complete is not received within timeout s,</span><br><span style="color: hsl(0, 100%, 40%);">- * release the SCCP connection. */</span><br><span style="color: hsl(120, 100%, 40%);">+/* Transmit a Iu Release Command and submit event RANAP_IU_EVENT_IU_RELEASE upon</span><br><span style="color: hsl(120, 100%, 40%);">+   Release Complete or timeout. Caller is responsible to free the context and</span><br><span style="color: hsl(120, 100%, 40%);">+   closing the SCCP connection (ranap_iu_free_ue) upon recieval of the event. */</span><br><span> void ranap_iu_tx_release_free(struct ranap_ue_conn_ctx *ctx,</span><br><span>                             const struct RANAP_Cause *cause,</span><br><span>                             int timeout);</span><br><span>diff --git a/src/iu_client.c b/src/iu_client.c</span><br><span>index 06285ec..da433da 100644</span><br><span>--- a/src/iu_client.c</span><br><span>+++ b/src/iu_client.c</span><br><span>@@ -124,6 +124,12 @@</span><br><span>  return global_iu_event_cb(ue_ctx, type, data);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void ue_conn_ctx_release_timeout_cb(void *ctx_)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    struct ranap_ue_conn_ctx *ctx = (struct ranap_ue_conn_ctx *)ctx_;</span><br><span style="color: hsl(120, 100%, 40%);">+     global_iu_event(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uint32_t conn_id)</span><br><span> {</span><br><span>   struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx);</span><br><span>@@ -133,7 +139,7 @@</span><br><span>  ctx->notification = true;</span><br><span>         ctx->free_on_release = false;</span><br><span>     osmo_timer_setup(&ctx->release_timeout,</span><br><span style="color: hsl(0, 100%, 40%);">-                   (void *)(void *) ranap_iu_free_ue,</span><br><span style="color: hsl(120, 100%, 40%);">+                    ue_conn_ctx_release_timeout_cb,</span><br><span>                      ctx);</span><br><span>       llist_add(&ctx->list, &ue_conn_ctx_list);</span><br><span> </span><br><span>@@ -501,10 +507,9 @@</span><br><span>      ctx->notification = false;</span><br><span>        ctx->free_on_release = true;</span><br><span>      int ret = ranap_iu_tx_release(ctx, cause);</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ret) {</span><br><span style="color: hsl(0, 100%, 40%);">-              ranap_iu_free_ue(ctx);</span><br><span style="color: hsl(0, 100%, 40%);">-          return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* On Tx failure, trigger timeout immediately, as the response will never arrive */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (ret)</span><br><span style="color: hsl(120, 100%, 40%);">+              timeout = 0;</span><br><span> </span><br><span>     osmo_timer_schedule(&ctx->release_timeout, timeout, 0);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-iuh/+/23742">change 23742</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-iuh/+/23742"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-iuh </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iac822c74e56750dc40e94573eae0e20853ff68c0 </div>
<div style="display:none"> Gerrit-Change-Number: 23742 </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>