diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-05-29 16:53:23 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-06-18 11:23:35 +0000 |
commit | b26a5a82dbbb8b24d9d1d5cbbf7bbfdf7e4df645 (patch) | |
tree | 484626201be46ef559edc7ad0777970cc8e0366b /src/gbproxy/gb_proxy_tlli.c | |
parent | 7369d449f1446f598e9084712ddfa4a5bceb17ee (diff) |
use new osmo_mobile_identity API everywhere
Depends: If4f7be606e54cfa1c59084cf169785b1cbda5cf5 (libosmocore)
Change-Id: I4cacb10bac419633ca0c14f244f9903f7f517b49
Diffstat (limited to 'src/gbproxy/gb_proxy_tlli.c')
-rw-r--r-- | src/gbproxy/gb_proxy_tlli.c | 18 |
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 */ |