[PATCH] libosmocore[master]: Fix malformed Abis/RSL messages

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Jul 14 14:08:26 UTC 2017


Review at  https://gerrit.osmocom.org/3258

Fix malformed Abis/RSL messages

Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344
---
M src/gsm/lapdm.c
1 file changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3258/1

diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index db950a6..b1107c8 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -419,6 +419,12 @@
 		rll_msg = RSL_MT_EST_IND;
 		break;
 	case OSMO_PRIM(PRIM_DL_EST, PRIM_OP_CONFIRM):
+		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_CONF;
 		break;
 	case OSMO_PRIM(PRIM_DL_DATA, PRIM_OP_INDICATION):
@@ -427,9 +433,21 @@
 	case OSMO_PRIM(PRIM_DL_UNIT_DATA, PRIM_OP_INDICATION):
 		return send_rslms_rll_l3_ui(mctx, dp->oph.msg);
 	case OSMO_PRIM(PRIM_DL_REL, 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_REL_IND;
 		break;
 	case OSMO_PRIM(PRIM_DL_REL, PRIM_OP_CONFIRM):
+		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_REL_CONF;
 		break;
 	case OSMO_PRIM(PRIM_DL_SUSP, PRIM_OP_CONFIRM):

-- 
To view, visit https://gerrit.osmocom.org/3258
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Minh-Quang Nguyen <minh-quang.nguyen at nutaq.com>



More information about the gerrit-log mailing list