Change in osmo-bts[master]: Fix passing of RR SUSPEND REQ from DCCH to PCU socket

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon May 27 15:47:16 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14193 )

Change subject: Fix passing of RR SUSPEND REQ from DCCH to PCU socket
......................................................................

Fix passing of RR SUSPEND REQ from DCCH to PCU socket

The existing code ssumed that the RR SUSPEND REQ would be a
LAPDm/RSL unitdata request.  I couldn't find any spec reference
that would support this.  Rather, the message is sent via the normal
main dedicated channel, which is operated in ABM mode.

As the somewhat similar check for diverting measurement results
is in fact looking for UNITDATA, we have to untangle this slightly.

Change-Id: Ic75486f8edaefa9c07bd92515ba1832b1c482fa6
Related: OS#2249
Related: OS#4023
---
M src/common/rsl.c
1 file changed, 33 insertions(+), 9 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/common/rsl.c b/src/common/rsl.c
index f8c7daa..f76a006 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2642,7 +2642,17 @@
 		return 0;
 }
 
-static int rslms_get_meas_msg_type(struct msgb *msg, bool rllh_link_id_is_sacch)
+static int rslms_get_rll_msg_type(struct msgb *msg)
+{
+	struct abis_rsl_common_hdr *rh = msgb_l2(msg);
+
+	if ((rh->msg_discr & 0xfe) != ABIS_RSL_MDISC_RLL)
+		return -1;
+
+	return rh->msg_type;
+}
+
+static int rslms_get_rr_msg_type(struct msgb *msg, bool rllh_link_id_is_sacch)
 {
 	struct abis_rsl_common_hdr *rh = msgb_l2(msg);
 	struct abis_rsl_rll_hdr *rllh;
@@ -2651,8 +2661,6 @@
 	if ((rh->msg_discr & 0xfe) != ABIS_RSL_MDISC_RLL)
 		return -1;
 
-	if (rh->msg_type != RSL_MT_UNIT_DATA_IND)
-		return -2;
 
 	rllh = msgb_l2(msg);
 	if (rsl_link_id_is_sacch(rllh->link_id) != rllh_link_id_is_sacch)
@@ -2665,23 +2673,39 @@
 	return gh->msg_type;
 }
 
-static int rslms_is_meas_rep(struct msgb *msg)
+static bool rslms_is_meas_rep(struct msgb *msg)
 {
-	switch (rslms_get_meas_msg_type(msg, 1)) {
+	int rll_msg_type = rslms_get_rll_msg_type(msg);
+	int rr_msg_type;
+
+	if (rll_msg_type != RSL_MT_UNIT_DATA_IND)
+		return false;
+
+	rr_msg_type = rslms_get_rr_msg_type(msg, 1);
+
+	switch (rr_msg_type) {
 	case GSM48_MT_RR_MEAS_REP:
 	case GSM48_MT_RR_EXT_MEAS_REP:
-		return 1;
+		return true;
 	}
 
 	/* FIXME: this does not cover the Bter frame format and the associated
 	 * short RR protocol descriptor for ENHANCED MEASUREMENT REPORT */
 
-	return 0;
+	return false;
 }
 
-static int rslms_is_gprs_susp_req(struct msgb *msg)
+static bool rslms_is_gprs_susp_req(struct msgb *msg)
 {
-	return rslms_get_meas_msg_type(msg, 0) == GSM48_MT_RR_GPRS_SUSP_REQ;
+	int rll_msg_type = rslms_get_rll_msg_type(msg);
+	int rr_msg_type;
+
+	if (rll_msg_type != RSL_MT_DATA_IND)
+		return false;
+
+	rr_msg_type = rslms_get_rr_msg_type(msg, false);
+
+	return rr_msg_type == GSM48_MT_RR_GPRS_SUSP_REQ;
 }
 
 /* TS 44.018 9.1.13b GPRS suspension request */

-- 
To view, visit https://gerrit.osmocom.org/14193
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic75486f8edaefa9c07bd92515ba1832b1c482fa6
Gerrit-Change-Number: 14193
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190527/e0252193/attachment.html>


More information about the gerrit-log mailing list