<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15188">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_sgsn.c: Remove recently introduced assert<br><br>Recent commit added an assert to make sure unexpected conditions were<br>happening in sgsn_mm_ctx_cleanup_free(). Old code was passing<br>mm->gb.tlli to gprs_llgmm_assign with "new tlli" being all-1's (aka<br>unassign mm->gb.tlli).<br>The commit changed the code to use gprs_llgmm_unassign, which uses<br>llme->tlli instead of mm->gb.tlli, and the assert was used to make sure<br>no behavior change occured with the commit.<br>It seems TTCN3 test TC_attach_auth_id_timeout triggers that assert, and<br>after closer debug it seems mm->gb.tlli == llme->old_tlli, which makes<br>sense since there's a mm->gb.tlli_new which is expected to be<br>llme->tlli.<br>When TLLI changes in GMM, it is stored into mm->gb.tlli_new and assigned<br>on the LLC layer using gprs_llgm_assign(), and at the end of the function<br>(after handling messages) it is assigned to mm->gb.tlli (and value kept<br>in mm->gb.tlli_new).<br>So mm->gb.tlli and mm->gb.tlli_new usually contain the same value unless<br>a new TLLI is allocated, and during the span of the Rx path it is kept<br>different, the LLC layer having assigned the value of mm->gb.tlli_new.<br>So,  old code (before the commit adding the assert) was wrongly using<br>mm->gb.tlli instead of mm->gb.tlli_new at the moment of unassigning (but<br>not really problematic in practice since behavior is the same as long as<br>"old TLLI" value is not all-1's.<br>So we are fine and correct using gprs_llgm_unassign() (which passes llme->tlli<br>as "old TLLI") instead of what used to be done before.<br>In any case, the expected behavior is to free the llme object and get<br>rid of everything...<br><br>Fixes: 788863cda53298c24110d0fe0f8cd3309cdec747<br>Change-Id: I482acdbdf05ce0cb0a5804206672512854067f5b<br>---<br>M src/gprs/gprs_sgsn.c<br>1 file changed, 0 insertions(+), 2 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/88/15188/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c</span><br><span>index 8f1e54a..eb04846 100644</span><br><span>--- a/src/gprs/gprs_sgsn.c</span><br><span>+++ b/src/gprs/gprs_sgsn.c</span><br><span>@@ -313,7 +313,6 @@</span><br><span> void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm)</span><br><span> {</span><br><span>  struct gprs_llc_llme *llme = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-      uint32_t tlli = mm->gb.tlli;</span><br><span>      struct sgsn_pdp_ctx *pdp, *pdp2;</span><br><span>     struct sgsn_signal_data sig_data;</span><br><span> </span><br><span>@@ -362,7 +361,6 @@</span><br><span> </span><br><span>      if (llme) {</span><br><span>          /* TLLI unassignment, must be called after sgsn_mm_ctx_free */</span><br><span style="color: hsl(0, 100%, 40%);">-          OSMO_ASSERT(llme->tlli == tlli);</span><br><span>          if (gprs_llgmm_unassign(llme) < 0)</span><br><span>                        LOGMMCTXP(LOGL_ERROR, mm, "gprs_llgmm_unassign failed, llme not freed!\n");</span><br><span>        }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15188">change 15188</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/+/15188"/><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: I482acdbdf05ce0cb0a5804206672512854067f5b </div>
<div style="display:none"> Gerrit-Change-Number: 15188 </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>