From 9dd3bf0cb4e780b54772f4abe1e2966b09f99301 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 29 Feb 2016 08:49:22 -0500 Subject: Fix malformed Abis/RSL messages with extra L3 Information field Some Abis/RSL messages such as "Release Indication" contained 3 extra bytes from an L3 Information header which should not be there according to specs in GSM 08.58 (section 8.3 "Radio link layer management messages"). Other RSL messages were affected by the same issue, except for "Establish Indication", which had already a workaround in send_rslms_dlsap. This commit fixes the issue in a generic way, removes the "Establish Indication" and fixes the test accounting for the bug, as it otherwise fails after applying the changes. Fixes: OS#1635, OS#2336 Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344 --- src/gsm/lapd_core.c | 4 +--- src/gsm/lapdm.c | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src/gsm') diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 48476266..5d871546 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -379,9 +379,7 @@ static int send_dl_l3(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx, static inline int send_dl_simple(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx) { - struct msgb *msg = lapd_msgb_alloc(0, "DUMMY"); - - return send_dl_l3(prim, op, lctx, msg); + return send_dl_l3(prim, op, lctx, NULL); } /* send MDL-ERROR INDICATION */ diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 7ca2b3e3..80c0d178 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -414,11 +414,6 @@ static int send_rslms_dlsap(struct osmo_dlsap_prim *dp, switch (OSMO_PRIM_HDR(&dp->oph)) { case OSMO_PRIM(PRIM_DL_EST, PRIM_OP_INDICATION): - if (dp->oph.msg && dp->oph.msg->len == 0) { - /* omit L3 info by freeing message */ - msgb_free(dp->oph.msg); - dp->oph.msg = NULL; - } rll_msg = RSL_MT_EST_IND; break; case OSMO_PRIM(PRIM_DL_EST, PRIM_OP_CONFIRM): -- cgit v1.2.3