aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbproxy/gb_proxy_tlli.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-05-29 16:53:23 +0200
committerlaforge <laforge@osmocom.org>2020-06-18 11:23:35 +0000
commitb26a5a82dbbb8b24d9d1d5cbbf7bbfdf7e4df645 (patch)
tree484626201be46ef559edc7ad0777970cc8e0366b /src/gbproxy/gb_proxy_tlli.c
parent7369d449f1446f598e9084712ddfa4a5bceb17ee (diff)
use new osmo_mobile_identity API everywhere
Diffstat (limited to 'src/gbproxy/gb_proxy_tlli.c')
-rw-r--r--src/gbproxy/gb_proxy_tlli.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gbproxy/gb_proxy_tlli.c b/src/gbproxy/gb_proxy_tlli.c
index 4e21ede86..e9271c22c 100644
--- a/src/gbproxy/gb_proxy_tlli.c
+++ b/src/gbproxy/gb_proxy_tlli.c
@@ -401,14 +401,16 @@ static void gbproxy_assign_imsi(struct gbproxy_peer *peer,
peer, parse_ctx->imsi, parse_ctx->imsi_len);
if (other_link_info && other_link_info != link_info) {
- char mi_buf[200];
- mi_buf[0] = '\0';
- gsm48_mi_to_string(mi_buf, sizeof(mi_buf),
- parse_ctx->imsi, parse_ctx->imsi_len);
- LOGP(DGPRS, LOGL_INFO,
- "Removing TLLI %08x from list (IMSI %s re-used)\n",
- other_link_info->tlli.current, mi_buf);
- gbproxy_delete_link_info(peer, other_link_info);
+ struct osmo_mobile_identity mi;
+ if (osmo_mobile_identity_decode(&mi, parse_ctx->imsi, parse_ctx->imsi_len, false)
+ || mi.type != GSM_MI_TYPE_IMSI) {
+ LOGP(DGPRS, LOGL_ERROR, "Failed to decode Mobile Identity\n");
+ } else {
+ LOGP(DGPRS, LOGL_INFO,
+ "Removing TLLI %08x from list (IMSI %s re-used)\n",
+ other_link_info->tlli.current, mi.imsi);
+ gbproxy_delete_link_info(peer, other_link_info);
+ }
}
/* Update the IMSI field */