aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-13 14:17:23 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-24 16:16:39 +0200
commit3c5b40fb759e07bba63b06b80560f1c59125c8e0 (patch)
tree9a64107cc4597912e8c2052bf50567575ba46aba
parent3e23ddf88b38f9316b61daff6f8f41e57e883a14 (diff)
gbproxy: Update enable_patching flag on existing tlli_info
Currently the enable_patching field in tlli_info is not updated, when an IMSI is assigned to a TLLI that is already known. This patch fixes this in gbprox_update_state() after the call to gbprox_update_tlli_info(). The number of APN increases and the test output file is updated accordingly. Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gb_proxy.c10
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.ok14
2 files changed, 16 insertions, 8 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index dd7dead2b..5e19247a2 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -1437,10 +1437,18 @@ static struct gbproxy_tlli_info *gbprox_update_state(
gbprox_touch_tlli(peer, tlli_info, now);
}
- if (parse_ctx->imsi && tlli_info && tlli_info->mi_data_len == 0)
+ if (parse_ctx->imsi && tlli_info && tlli_info->mi_data_len == 0) {
+ int enable_patching;
gbprox_update_tlli_info(tlli_info,
parse_ctx->imsi, parse_ctx->imsi_len);
+ /* Check, whether the IMSI matches */
+ enable_patching = gbprox_check_imsi(peer, parse_ctx->imsi,
+ parse_ctx->imsi_len);
+ if (enable_patching >= 0)
+ tlli_info->enable_patching = enable_patching;
+ }
+
return tlli_info;
}
diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok
index 28d501660..a6ff67463 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.ok
+++ b/openbsc/tests/gbproxy/gbproxy_test.ok
@@ -1797,17 +1797,17 @@ PROCESSING ACT PDP CTX REQ (REMOVE APN) from 0x01020304:1111
CALLBACK, event 0, msg length 76, bvci 0x1002
00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 76 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 80
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
+NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 71 (gprs_ns_sendmsg)
+MESSAGE to SGSN at 0x05060708:32000, msg length 75
+00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 30 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 85 fa 60
-result (ACT PDP CTX REQ (REMOVE APN)) = 80
+result (ACT PDP CTX REQ (REMOVE APN)) = 75
Peers:
NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
RAID patched (BSS ): 12
RAID patched (SGSN): 3
- APN patched : 3
+ APN patched : 4
Attach Request count : 1
TLLI cache size : 1
TLLI-Cache: 1
@@ -1829,7 +1829,7 @@ Peers:
NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
RAID patched (BSS ): 13
RAID patched (SGSN): 3
- APN patched : 3
+ APN patched : 4
Attach Request count : 1
TLLI-Cache: 0
--- Bad cases ---
@@ -1867,7 +1867,7 @@ Peers:
NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
RAID patched (BSS ): 14
RAID patched (SGSN): 3
- APN patched : 3
+ APN patched : 4
Attach Request count : 1
TLLI cache size : 1
TLLI-Cache: 1