aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy_patch.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-02 16:14:47 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-09 18:12:27 +0200
commit49389178cc6059f4e80f30dda2192560e580b29d (patch)
treea35b4d0f5b0ff5e7c3e06add67ff62a00a282755 /openbsc/src/gprs/gb_proxy_patch.c
parent43b8f9f8a10c16ddbcd1caeae742aace0c5e4ee9 (diff)
gbproxy: Use pointer to PTMSI value instead of MI
Currently, ptmsi_enc and new_ptmsi_enc point to the beginning of the mobile identity. Since all P-TMSI in 04.08 (MM) are encoded this way (1 byte header + 4 byte P-TMSI value). This is different to the P-TMSI encoding in 08.18 (BSSGP), where the P-TMSI is encoded into 4 byte without MI header. This patch changes the code to use pointers to the P-TMSI value, which is encoded in the same way in both specifications. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gb_proxy_patch.c')
-rw-r--r--openbsc/src/gprs/gb_proxy_patch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/openbsc/src/gprs/gb_proxy_patch.c
index 5cac8a5d8..b14809495 100644
--- a/openbsc/src/gprs/gb_proxy_patch.c
+++ b/openbsc/src/gprs/gb_proxy_patch.c
@@ -172,7 +172,7 @@ static int gbproxy_patch_ptmsi(uint8_t *ptmsi_enc,
to_bss ?
GBPROX_PEER_CTR_PTMSI_PATCHED_SGSN :
GBPROX_PEER_CTR_PTMSI_PATCHED_BSS;
- memcpy(&ptmsi_be, ptmsi_enc + 1, sizeof(ptmsi_be));
+ memcpy(&ptmsi_be, ptmsi_enc, sizeof(ptmsi_be));
ptmsi = ntohl(ptmsi_be);
if (ptmsi == new_ptmsi)
@@ -184,7 +184,7 @@ static int gbproxy_patch_ptmsi(uint8_t *ptmsi_enc,
log_text, ptmsi, new_ptmsi);
ptmsi_be = htonl(new_ptmsi);
- memcpy(ptmsi_enc + 1, &ptmsi_be, sizeof(ptmsi_be));
+ memcpy(ptmsi_enc, &ptmsi_be, sizeof(ptmsi_be));
rate_ctr_inc(&peer->ctrg->ctr[counter]);