aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/pcu_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bsc/pcu_sock.c')
-rw-r--r--src/osmo-bsc/pcu_sock.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index b04140277..bb1874637 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -290,27 +290,30 @@ static int pcu_rx_rr_paging(struct gsm_bts *bts, uint8_t paging_group,
{
struct gsm48_paging1 *p1 = (struct gsm48_paging1 *) raw_rr_msg;
uint8_t chan_needed;
- unsigned int mi_len;
- uint8_t *mi;
+ struct osmo_mobile_identity mi;
int rc;
switch (p1->msg_type) {
case GSM48_MT_RR_PAG_REQ_1:
chan_needed = (p1->cneed2 << 2) | p1->cneed1;
- mi_len = p1->data[0];
- mi = p1->data+1;
+ rc = osmo_mobile_identity_decode(&mi, p1->data+1, p1->data[0], false);
+ if (rc) {
+ LOGP(DPCU, LOGL_ERROR, "PCU Sends paging "
+ "request type %02x (chan_needed=%02x): Unable to decode Mobile Identity\n",
+ p1->msg_type, chan_needed);
+ rc = -EINVAL;
+ break;
+ }
LOGP(DPCU, LOGL_ERROR, "PCU Sends paging "
- "request type %02x (chan_needed=%02x, mi_len=%u, mi=%s)\n",
- p1->msg_type, chan_needed, mi_len,
- osmo_hexdump_nospc(mi,mi_len));
+ "request type %02x (chan_needed=%02x, mi=%s)\n",
+ p1->msg_type, chan_needed, osmo_mobile_identity_to_str_c(OTC_SELECT, &mi));
/* NOTE: We will have to add 2 to mi_len and subtract 2 from
* the mi pointer because rsl_paging_cmd() will perform the
* reverse operations. This is because rsl_paging_cmd() is
* normally expected to chop off the element identifier (0xC0)
* and the length field. In our parameter, we do not have
* those fields included. */
- rc = rsl_paging_cmd(bts, paging_group, mi_len+2, mi-2,
- chan_needed, true);
+ rc = rsl_paging_cmd(bts, paging_group, &mi, chan_needed, true);
break;
case GSM48_MT_RR_PAG_REQ_2:
case GSM48_MT_RR_PAG_REQ_3: