From e27ab916d6bcbc4f6d5dd2725f37f39c76d7ce30 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Thu, 18 Sep 2014 10:08:27 +0200 Subject: [PATCH] gbproxy: Restart IMSI acquisition on RA UDP REQ Currently the IMSI acquisition is not restarted when a RA Update Request is received. This leads to repeated N(U) in the generated Ident Request message, which in turn causes the MS to drop the second of these message. This is bad, when the first Ident Response has been lost between MS and gbproxy. This patch changes gbproxy_imsi_acquisition() to handle RA Update Request messages like Attach Requests. Sponsored-by: On-Waves ehf --- openbsc/src/gprs/gb_proxy.c | 5 +++-- openbsc/tests/gbproxy/gbproxy_test.ok | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 4b46b0e2b..daa9ba08b 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -395,12 +395,13 @@ static int gbproxy_imsi_acquisition(struct gbproxy_peer *peer, if (parse_ctx->g48_hdr) switch (parse_ctx->g48_hdr->msg_type) { + case GSM48_MT_GMM_RA_UPD_REQ: case GSM48_MT_GMM_ATTACH_REQ: if (gbproxy_restart_imsi_acquisition(tlli_info)) { LOGP(DLLC, LOGL_INFO, "NSEI=%d(BSS) IMSI acquisition was in progress " - "when receiving an ATTACH_REQ.\n", - msgb_nsei(msg)); + "when receiving an %s.\n", + msgb_nsei(msg), parse_ctx->llc_msg_name); } break; case GSM48_MT_GMM_DETACH_REQ: diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index 8df833b47..9402c14f2 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -3568,6 +3568,10 @@ PROCESSING RA UPD REQ from 0x01020304:1111 CALLBACK, event 0, msg length 85, bvci 0x1002 00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 35 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 ac 9c 37 +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 28 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 05 08 15 01 8f 47 9e + result (RA UPD REQ) = 0 PROCESSING DETACH REQ from 0x01020304:1111 @@ -3578,7 +3582,7 @@ CALLBACK, event 0, msg length 44, bvci 0x1002 NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg) MESSAGE to BSS at 0x01020304:1111, msg length 28 -00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 06 00 11 f5 c0 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 05 08 06 00 29 4a 68 result (DETACH REQ) = 0