LAPDm: Ensure there is no payload in DISC frames

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.
This commit is contained in:
Harald Welte 2012-04-26 21:50:54 +02:00
parent 81cd54a0c3
commit 973c3c3f24
1 changed files with 6 additions and 1 deletions

View File

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