aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-26 19:08:59 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-26 19:08:59 +0800
commitac30cc833c60e5fac03faf5b72c8908b5c3275f9 (patch)
tree036e5fa164617e5cec729f5a53c93b435f286335
parentb02c89e292983def3656c64cdbd68f32953b210f (diff)
gsm_04_80: Use msgb_push to get the verification code of msgb
msgb started to verify that we do have enough tail/headroom and this code was not using this check.
-rw-r--r--openbsc/src/gsm_04_80.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/openbsc/src/gsm_04_80.c b/openbsc/src/gsm_04_80.c
index 757653ac4..462d9789e 100644
--- a/openbsc/src/gsm_04_80.c
+++ b/openbsc/src/gsm_04_80.c
@@ -51,22 +51,22 @@ static int parse_process_uss_req(u_int8_t *uss_req_data, u_int8_t length,
static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, u_int8_t tag)
{
- msgb->data -= 2;
- msgb->data[0] = tag;
- msgb->data[1] = msgb->len;
- msgb->len += 2;
- return msgb->data;
+ uint8_t *data = msgb_push(msgb, 2);
+
+ data[0] = tag;
+ data[1] = msgb->len;
+ return data;
}
static inline unsigned char *msgb_push_TLV1(struct msgb *msgb, u_int8_t tag,
u_int8_t value)
{
- msgb->data -= 3;
- msgb->len += 3;
- msgb->data[0] = tag;
- msgb->data[1] = 1;
- msgb->data[2] = value;
- return msgb->data;
+ uint8_t *data = msgb_push(msgb, 3);
+
+ data[0] = tag;
+ data[1] = 1;
+ data[2] = value;
+ return data;
}