aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-04-26 21:50:54 +0200
committerHarald Welte <laforge@gnumonks.org>2012-04-26 22:15:12 +0200
commit973c3c3f248cdf5e6d459517f612dc7b8bf36ca6 (patch)
treef0d1e11d71921b5d6b4d8537830e535e3a61c06d
parent81cd54a0c36cd9cf2bedd97221658a276aa2d84c (diff)
LAPDm: Ensure there is no payload in DISC frames0.4.2
When we send DISC frames (especially generated from RSL), we don't want any remaining bytes from the RSL message showing up as bogus DISC payload.
-rw-r--r--src/gsm/lapdm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index f123cb6..1c08113 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -959,7 +959,12 @@ static int rslms_rx_rll_rel_req(struct msgb *msg, struct lapdm_datalink *dl)
mode = rllh->data[1] & 1;
/* Pull rllh */
- msgb_pull(msg, msg->tail - msg->l2h);
+ msgb_pull_l2h(msg);
+
+ /* 04.06 3.8.3: No information field is permitted with the DISC
+ * command. */
+ msg->len = 0;
+ msg->tail = msg->l3h = msg->data;
/* prepare prim */
osmo_prim_init(&dp.oph, 0, PRIM_DL_REL, PRIM_OP_REQUEST, msg);