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
This commit is contained in:
Jacob Erlbeck 2014-10-22 12:20:26 +02:00 committed by Holger Hans Peter Freyther
parent c37ef6cd0e
commit fb26c60a2f
1 changed files with 10 additions and 0 deletions

View File

@ -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);