diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-11-03 10:12:52 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-11-03 10:21:20 +0100 |
commit | f00eb01918336841a2ff6ee42f58c9da70ae5794 (patch) | |
tree | d4073d6ba39f6a3e71ebd1a6b504531c36c038ec | |
parent | 3490aaa13707d9455093cc208a227cdc578bd259 (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.c | 10 |
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 */ |