aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-08-13 20:08:48 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-08-13 20:58:17 +0200
commitc488665f925c511b95e280b11bb0cffd262dc0ed (patch)
tree537c5bcdaef7f1f01b2efe457f6c56907d0df3e6
parent982e130144317869ba82f858ca21a62fa36ffaa4 (diff)
gprs_sgsn.c: Remove recently introduced assert
Recent commit added an assert to make sure unexpected conditions were happening in sgsn_mm_ctx_cleanup_free(). Old code was passing mm->gb.tlli to gprs_llgmm_assign with "new tlli" being all-1's (aka unassign mm->gb.tlli). The commit changed the code to use gprs_llgmm_unassign, which uses llme->tlli instead of mm->gb.tlli, and the assert was used to make sure no behavior change occured with the commit. It seems TTCN3 test TC_attach_auth_id_timeout triggers that assert, and after closer debug it seems mm->gb.tlli == llme->old_tlli, which makes sense since there's a mm->gb.tlli_new which is expected to be llme->tlli. When TLLI changes in GMM (Attach Request or RA Update), it is stored into mm->gb.tlli_new and assigned on the LLC layer using gprs_llgm_assign(), and upon completion signalling from MS, (after handling response to initial request) it is assigned to mm->gb.tlli (and value kept in mm->gb.tlli_new). So mm->gb.tlli and mm->gb.tlli_new usually contain the same value unless a new TLLI is allocated, and during the span of Request->Response->Complete it is kept different, the LLC layer having assigned the value of mm->gb.tlli_new. So, old code (before the commit adding the assert) was wrongly using mm->gb.tlli instead of mm->gb.tlli_new at the moment of unassigning (but not really problematic in practice since behavior is the same as long as "old TLLI" value is not all-1's. So we are fine and correct using gprs_llgm_unassign() (which passes llme->tlli as "old TLLI") instead of what used to be done before. In any case, the expected behavior is to free the llme object and get rid of everything... Fixes: 788863cda53298c24110d0fe0f8cd3309cdec747 Change-Id: I482acdbdf05ce0cb0a5804206672512854067f5b
-rw-r--r--src/gprs/gprs_sgsn.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 8f1e54a9c..eb04846eb 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -313,7 +313,6 @@ static void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm)
void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm)
{
struct gprs_llc_llme *llme = NULL;
- uint32_t tlli = mm->gb.tlli;
struct sgsn_pdp_ctx *pdp, *pdp2;
struct sgsn_signal_data sig_data;
@@ -362,7 +361,6 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm)
if (llme) {
/* TLLI unassignment, must be called after sgsn_mm_ctx_free */
- OSMO_ASSERT(llme->tlli == tlli);
if (gprs_llgmm_unassign(llme) < 0)
LOGMMCTXP(LOGL_ERROR, mm, "gprs_llgmm_unassign failed, llme not freed!\n");
}