summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-01-31 17:36:20 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2017-02-24 15:18:22 +0100
commit496013fc5b467a8b4620890e1f9381f453b7df87 (patch)
tree8adf2b0de324dafdc5cfea49dc253908e1216000
parentcc175fca80ea360080d01170b962a05c754ab806 (diff)
pcu_sock: fix paging group calculation
The offset for the data buffer, where the last three imsi digits are stored is wrong. Here we correct the problem.
-rw-r--r--openbsc/src/libbsc/pcu_sock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c
index 7399f9e..a6b874e 100644
--- a/openbsc/src/libbsc/pcu_sock.c
+++ b/openbsc/src/libbsc/pcu_sock.c
@@ -369,6 +369,8 @@ static uint8_t extract_paging_group(struct gsm_bts *bts, uint8_t *data)
pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
str_to_imsi(imsi_digit_buf));
+ LOGP(DPCU, LOGL_DEBUG, "Calculating paging group: imsi_digit_buf=%s ==> pag_grp=0x%02x\n", imsi_digit_buf, pag_grp);
+
return pag_grp;
}
@@ -414,9 +416,9 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
"invalid/small length %d\n", data_req->len);
break;
}
- tlli = *((uint32_t *)data_req->data);
- pag_grp = extract_paging_group(bts,data_req->data);
+ memcpy(&tlli,data_req->data,sizeof(tlli));
+ pag_grp = extract_paging_group(bts,data_req->data+4);
msg = msgb_alloc(data_req->len - 7, "pcu_pch");
if (!msg) {