summaryrefslogtreecommitdiffstats
path: root/src/gsm
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-12 23:12:28 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-12 23:23:19 +0100
commit3a5f08c221b32381623e50095de2751183e994c4 (patch)
tree217cadb3a8a791a7db85e18b24741c9ee19a5227 /src/gsm
parent90656dbd00c32b56a6082d7baf4fc752adcf85dd (diff)
lapdm: Make sure that the msgb_l3len(msg) == length...
This code should not play with the internals of the msgb like this, this code got introduced in af48bed55607931307 and is breaking the osmo-bts usecase of forwarding an RSL message. Add a test case that fails without the new code. I would prefer if we could get rid of the manipulating the msgb like this, it is prone to errors like this one.
Diffstat (limited to 'src/gsm')
-rw-r--r--src/gsm/lapdm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index 3d2f3d83..e9ce881b 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -792,7 +792,7 @@ static int rslms_rx_rll_est_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
- msg->tail = msg->data + length;
+ msg->tail = msg->l3h + length;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, PRIM_DL_EST, PRIM_OP_REQUEST, msg);
@@ -845,7 +845,7 @@ static int rslms_rx_rll_udata_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
- msg->tail = msg->data + length;
+ msg->tail = msg->l3h + length;
/* Push L1 + LAPDm header on msgb */
msg->l2h = msgb_push(msg, 4 + !ui_bts);
@@ -881,7 +881,7 @@ static int rslms_rx_rll_data_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
- msg->tail = msg->data + length;
+ msg->tail = msg->l3h + length;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, PRIM_DL_DATA, PRIM_OP_REQUEST, msg);
@@ -938,7 +938,7 @@ static int rslms_rx_rll_res_req(struct msgb *msg, struct lapdm_datalink *dl)
/* Remove RLL header from msgb and set length to L3-info */
msgb_pull_l2h(msg);
msg->len = length;
- msg->tail = msg->data + length;
+ msg->tail = msg->l3h + length;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, (msg_type == RSL_MT_RES_REQ) ? PRIM_DL_RES