aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-11-03 10:12:52 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-14 09:16:58 +0100
commita790456f1b826ea204f47c4aa4973dc777d00d2a (patch)
treed181f4aef93c3068380f5d6b69f53370f7de7b84
parent0074a77424c95d2d7d0608dc0dfabc1948e62fe0 (diff)
sgsn: Call mm_ctx_cleanup_free to deregister MM context
Currently the MM context isn't always removed when it is de-registered (mmctx_timer_cb), mm_state is set to GMM_DEREGISTERED instead. This can lead to left-over MM contexts which are only cleaned up if the MS reattaches. This patch replaces all of these assignments by a call to mm_ctx_cleanup_free. Ticket: OW#1324 Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gprs_gmm.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 9f34b4ded..389123d05 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -712,8 +712,6 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg)
"p_tmsi_old=0x%08x\n",
ictx->p_tmsi);
- ictx->mm_state = GMM_DEREGISTERED;
-
mm_ctx_cleanup_free(ictx, "GPRS IMSI re-use");
}
}
@@ -1242,9 +1240,7 @@ static void mmctx_timer_cb(void *_mm)
case 3350: /* waiting for ATTACH COMPLETE */
if (mm->num_T_exp >= 5) {
LOGMMCTXP(LOGL_NOTICE, mm, "T3350 expired >= 5 times\n");
- mm->mm_state = GMM_DEREGISTERED;
- mm->t3350_mode = GMM_T3350_MODE_NONE;
- mm->pending_req = 0;
+ mm_ctx_cleanup_free(mm, "T3350");
/* FIXME: should we return some error? */
break;
}
@@ -1269,7 +1265,7 @@ static void mmctx_timer_cb(void *_mm)
case 3360: /* waiting for AUTH AND CIPH RESP */
if (mm->num_T_exp >= 5) {
LOGMMCTXP(LOGL_NOTICE, mm, "T3360 expired >= 5 times\n");
- mm->mm_state = GMM_DEREGISTERED;
+ mm_ctx_cleanup_free(mm, "T3360");
break;
}
/* FIXME: re-transmit the respective msg and re-start timer */
@@ -1279,7 +1275,7 @@ static void mmctx_timer_cb(void *_mm)
if (mm->num_T_exp >= 5) {
LOGMMCTXP(LOGL_NOTICE, mm, "T3370 expired >= 5 times\n");
gsm48_tx_gmm_att_rej(mm, GMM_CAUSE_MS_ID_NOT_DERIVED);
- mm->mm_state = GMM_DEREGISTERED;
+ mm_ctx_cleanup_free(mm, "GPRS ATTACH REJECT (T3370)");
break;
}
/* re-tranmit IDENTITY REQUEST and re-start timer */