diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-10-22 12:20:26 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-10-27 13:06:55 +0100 |
commit | fb26c60a2faf48339f09b336977eccf3d300cba4 (patch) | |
tree | c127fe82c4ac7feaed707b70c965d335a3715be3 | |
parent | c37ef6cd0e535558b1cc672aa3964eeb506b3f25 (diff) |
sgsn: Avoid duplicated Attach Accept messages
Currently each received Ident Resp triggers an Attach Accept/Reject
if IMSI and IMEI are known. This has led to duplicated Attach Accept
messages when used with the gbproxy (IMSI acquisition active) and
with certain mobile equipment (iOS).
This patch modifies gsm48_rx_gmm_id_resp to discard Ident Resp messages
if all required information (IMEI and IMSI) has been gathered.
Ticket: OW#1322
Sponsored-by: On-Waves ehf
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index c55c300c1..99ab2765c 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -626,6 +626,8 @@ static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx, { if (strlen(ctx->imei) && strlen(ctx->imsi)) { #ifdef PTMSI_ALLOC + ctx->t3370_id_type = GSM_MI_TYPE_NONE; + /* Start T3350 and re-transmit up to 5 times until ATTACH COMPLETE */ ctx->t3350_mode = t3350_mode; mmctx_timer_start(ctx, 3350, GSM0408_T3350_SECS); @@ -666,6 +668,14 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg) LOGMMCTXP(LOGL_DEBUG, ctx, "-> GMM IDENTITY RESPONSE: mi_type=0x%02x MI(%s)\n", mi_type, mi_string); + if (ctx->t3370_id_type == GSM_MI_TYPE_NONE) { + LOGMMCTXP(LOGL_NOTICE, ctx, + "Got unexpected IDENTITY RESPONSE: mi_type=0x%02x MI(%s), " + "ignoring message\n", + mi_type, mi_string); + return -EINVAL; + } + if (mi_type == ctx->t3370_id_type) mmctx_timer_stop(ctx, 3370); |