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.
This commit is contained in:
Holger Hans Peter Freyther 2010-07-26 19:08:59 +08:00
parent b02c89e292
commit ac30cc833c
1 changed files with 11 additions and 11 deletions

View File

@ -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;
}