aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
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-29 04:23:25 +0800
commitbfc36880246a7a76ab6bce3a02610a42c1e9da15 (patch)
tree6bb91383f8a7f8e037f64c875c22bfaa25ce349c /openbsc
parentc50510b67e8ce0509980f924d08a0772ebf043a5 (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.
Diffstat (limited to 'openbsc')
-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 dc9ade478..fd5882431 100644
--- a/openbsc/src/gsm_04_80.c
+++ b/openbsc/src/gsm_04_80.c
@@ -50,22 +50,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;
}