summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-24 00:13:17 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-24 00:13:17 +0200
commitbee8a01b8d5bf8a64c98aca9c3968b12da6d2d4c (patch)
tree32fc1e0515c15a1bcfdd82415454e44e7093fb66
parent88f5d463d22e1f4954c44c5391706e25fda77969 (diff)
lapdm: use msgb_tlv_put instead of manual equivalent
-rw-r--r--src/host/layer23/src/common/lapdm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/host/layer23/src/common/lapdm.c b/src/host/layer23/src/common/lapdm.c
index 6aad8760..e6fc75e0 100644
--- a/src/host/layer23/src/common/lapdm.c
+++ b/src/host/layer23/src/common/lapdm.c
@@ -427,15 +427,11 @@ static int send_rll_simple(uint8_t msg_type, struct lapdm_msg_ctx *mctx)
static int rsl_rll_error(uint8_t cause, struct lapdm_msg_ctx *mctx)
{
struct msgb *msg;
- uint8_t *tlv;
LOGP(DLAPDM, LOGL_NOTICE, "sending MDL-ERROR-IND %d\n", cause);
msg = rsl_rll_simple(RSL_MT_ERROR_IND, mctx->chan_nr, mctx->link_id, 1);
- msg->l2h = msgb_put(msg, sizeof(struct abis_rsl_rll_hdr) + 3);
- tlv = msg->l2h + sizeof(struct abis_rsl_rll_hdr);
- tlv[0] = RSL_IE_RLM_CAUSE;
- tlv[1] = 1;
- tlv[2] = cause;
+ msg->l2h = msgb_put(msg, sizeof(struct abis_rsl_rll_hdr));
+ msgb_tlv_put(msg, RSL_IE_RLM_CAUSE, 1, &cause);
return rslms_sendmsg(msg, mctx->dl->entity);
}