aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-11-04 12:55:16 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2012-12-18 10:04:24 +0100
commit106ea79337c98fd1f2bda28af6979401cf05d78f (patch)
tree07e3b70b93764d6670b95ae42d4bcd6bd217fcb3
parentd87b4685b8046b0f89c5ec3b26f0f3adcf4b638a (diff)
Fix: Align TLLI to 32 bit margin, before converting it
-rw-r--r--src/gprs_rlcmac_data.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gprs_rlcmac_data.cpp b/src/gprs_rlcmac_data.cpp
index 8e9f471..bbfdabd 100644
--- a/src/gprs_rlcmac_data.cpp
+++ b/src/gprs_rlcmac_data.cpp
@@ -547,6 +547,7 @@ static int tlli_from_ul_data(uint8_t *data, uint8_t len, uint32_t *tlli)
struct rlc_ul_header *rh = (struct rlc_ul_header *)data;
struct rlc_li_field *li;
uint8_t e;
+ uint32_t _tlli;
if (!rh->ti)
return -EINVAL;
@@ -575,7 +576,8 @@ static int tlli_from_ul_data(uint8_t *data, uint8_t len, uint32_t *tlli)
"border\n");
return -EINVAL;
}
- *tlli = ntohl(*((uint32_t *)data));
+ memcpy(&_tlli, data, 4);
+ *tlli = ntohl(_tlli);
return 0;
}