<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-iuh/+/15474">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">iu_client: introduce UE field free_on_release<br><br>Allow to free UE ctx when receiving a Iu Release Complete.<br>In preparation of ranap_iu_tx_release_free() it requires<br>a field to free the Iu ctx on it's own without depending<br>on the upstream user.<br><br>Change-Id: Iac41cd3cce3232d01b2f7ede0cc46226c2cfb6c0<br>---<br>M include/osmocom/ranap/iu_client.h<br>M src/iu_client.c<br>2 files changed, 11 insertions(+), 0 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/74/15474/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 9da611b..78bb047 100644</span><br><span>--- a/include/osmocom/ranap/iu_client.h</span><br><span>+++ b/include/osmocom/ranap/iu_client.h</span><br><span>@@ -31,6 +31,8 @@</span><br><span>      struct gprs_ra_id ra_id;</span><br><span>     enum ranap_nsap_addr_enc rab_assign_addr_enc;</span><br><span>        bool notification; /* send notification to the upstream user */</span><br><span style="color: hsl(120, 100%, 40%);">+       /* if true the ue_ctx will be free on Iu release complete */</span><br><span style="color: hsl(120, 100%, 40%);">+  bool free_on_release;</span><br><span>        /* Will be set when the Iu Release Command has been sent */</span><br><span>  struct osmo_timer_list release_timeout;</span><br><span> };</span><br><span>diff --git a/src/iu_client.c b/src/iu_client.c</span><br><span>index fe1b880..5072cba 100644</span><br><span>--- a/src/iu_client.c</span><br><span>+++ b/src/iu_client.c</span><br><span>@@ -129,6 +129,7 @@</span><br><span>         ctx->rnc = rnc;</span><br><span>   ctx->conn_id = conn_id;</span><br><span>   ctx->notification = true;</span><br><span style="color: hsl(120, 100%, 40%);">+  ctx->free_on_release = false;</span><br><span>     osmo_timer_setup(&ctx->release_timeout,</span><br><span>                       (void *)(void *) ranap_iu_free_ue,</span><br><span>                   ctx);</span><br><span>@@ -500,6 +501,7 @@</span><br><span>                       int timeout)</span><br><span> {</span><br><span>       ctx->notification = false;</span><br><span style="color: hsl(120, 100%, 40%);">+ ctx->free_on_release = true;</span><br><span>      int ret = ranap_iu_tx_release(ctx, cause);</span><br><span>   if (ret) {</span><br><span>           ranap_iu_free_ue(ctx);</span><br><span>@@ -851,6 +853,13 @@</span><br><span>                        break;</span><br><span> </span><br><span>           global_iu_event(ue, RANAP_IU_EVENT_LINK_INVALIDATED, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+         /* A RANAP_IU_EVENT_LINK_INVALIDATED, can lead to a free */</span><br><span style="color: hsl(120, 100%, 40%);">+           ue = ue_conn_ctx_find(prim->u.disconnect.conn_id);</span><br><span style="color: hsl(120, 100%, 40%);">+         if (!ue)</span><br><span style="color: hsl(120, 100%, 40%);">+                      break;</span><br><span style="color: hsl(120, 100%, 40%);">+                if (ue->free_on_release)</span><br><span style="color: hsl(120, 100%, 40%);">+                   ranap_iu_free_ue(ue);</span><br><span>                break;</span><br><span>       case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION):</span><br><span>            /* connection-oriented data received */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-iuh/+/15474">change 15474</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/+/15474"/><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: Iac41cd3cce3232d01b2f7ede0cc46226c2cfb6c0 </div>
<div style="display:none"> Gerrit-Change-Number: 15474 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>