diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-01-20 17:20:51 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-01-20 17:21:36 +0100 |
commit | d55cef9b07b9a446cca62bb3784395b5e5733e1b (patch) | |
tree | a53ec0d192c4818b2c2b6d101008ddb6c51706dc /openbsc/src/osmo-bsc/osmo_bsc_bssap.c | |
parent | 7d60bdb2c2f9824b08f2bda9e9dbecf295de2074 (diff) |
osmo-bsc: correctly parse the TMSI in BSSAP paging from MSC
the TMSI is a uint32_t big-endian value and not a gsm 04.08 mobile
identity like the IMSI.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_bssap.c')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_bssap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c index 495a31325..2fbcbe5ee 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c @@ -133,13 +133,11 @@ static int bssmap_handle_paging(struct gsm_network *net, return -1; } - if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI)) { - gsm48_mi_to_string(mi_string, sizeof(mi_string), - TLVP_VAL(&tp, GSM0808_IE_TMSI), TLVP_LEN(&tp, GSM0808_IE_TMSI)); - tmsi = strtoul(mi_string, NULL, 10); + if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI) && + TLVP_LEN(&tp, GSM0808_IE_TMSI) == 4) { + tmsi = ntohl(*(uint32_t *) TLVP_VAL(&tp, GSM0808_IE_TMSI)); } - /* * parse the IMSI */ |