diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2016-05-21 00:48:49 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-06-02 03:01:04 +0200 |
commit | 7ec8ca422cb76c876dcd5c8a9e23d48090d40580 (patch) | |
tree | b69c97df93793b13cb00706310dab1a13841df5b /openbsc/src/gprs/gprs_sgsn.c | |
parent | 2b2429eb59af1edc9e8760a441c8c457418a459c (diff) |
sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu)
Assert that llme is unused for non-Gb (Iu) connections, and clean up otherwise.
Make sure the cleanup is left below the sgsn_mm_ctx_free() call, as the comment
states.
Change-Id: I891ae21afc1f4f60580b822273b5435e0e17d46f
Diffstat (limited to 'openbsc/src/gprs/gprs_sgsn.c')
-rw-r--r-- | openbsc/src/gprs/gprs_sgsn.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 8bb68509e..722edecec 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -197,11 +197,16 @@ 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 = mm->gb.llme; + struct gprs_llc_llme *llme = NULL; uint32_t tlli = mm->gb.tlli; struct sgsn_pdp_ctx *pdp, *pdp2; struct sgsn_signal_data sig_data; + if (mm->ran_type == MM_CTX_T_GERAN_Gb) + llme = mm->gb.llme; + else + OSMO_ASSERT(mm->gb.llme == NULL); + /* Forget about ongoing look-ups */ if (mm->ggsn_lookup) { LOGMMCTXP(LOGL_NOTICE, mm, @@ -237,8 +242,10 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm) sgsn_mm_ctx_free(mm); mm = NULL; - /* TLLI unassignment, must be called after sgsn_mm_ctx_free */ - gprs_llgmm_assign(llme, tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + if (llme) { + /* TLLI unassignment, must be called after sgsn_mm_ctx_free */ + gprs_llgmm_assign(llme, tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + } } |