aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-06-11 11:27:59 +0200
committerHarald Welte <laforge@gnumonks.org>2017-06-11 11:40:19 +0200
commit49b78229ca7dde50e1264d84c59deed4ffbdd97d (patch)
treed99af6d906ea152c1a7f43e0c1d47e547a5f8eaf
parentc136be04f7784d245baf0adb2e2537ac0fae206d (diff)
use tlvp_val16be() rather than manual pointer-cast + ntohs()
-rw-r--r--src/gprs_bssgp_pcu.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index aeb0942..d3c8491 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -155,9 +155,8 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
if (TLVP_PRESENT(tp, BSSGP_IE_PDU_LIFETIME))
{
uint8_t lt_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME);
- uint16_t *lt = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_PDU_LIFETIME);
if (lt_len == 2)
- delay_csec = ntohs(*lt);
+ delay_csec = tlvp_val16be(tp, BSSGP_IE_PDU_LIFETIME);
else
LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of "
"PDU_LIFETIME IE\n");
@@ -169,9 +168,8 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
if (TLVP_PRESENT(tp, BSSGP_IE_TLLI))
{
uint8_t tlli_len = TLVP_LEN(tp, BSSGP_IE_PDU_LIFETIME);
- uint16_t *e_tlli_old = (uint16_t *) TLVP_VAL(tp, BSSGP_IE_TLLI);
if (tlli_len == 2)
- tlli_old = ntohs(*e_tlli_old);
+ tlli_old = tlvp_val16be(tp, BSSGP_IE_TLLI);
else
LOGP(DBSSGP, LOGL_NOTICE, "BSSGP invalid length of "
"TLLI (old) IE\n");