aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-26 22:40:32 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-27 15:47:15 +0000
commit9ef6fa079885b67a0aed14c911b104a4967beeb8 (patch)
treee4e89d9d4249d0da3d15a32af5f89867131b1864
parent0cb2829f17202941a205cd1c3ae1ec26823ad5f3 (diff)
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
-rw-r--r--src/common/rsl.c42
1 files changed, 33 insertions, 9 deletions
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 @@ static inline int rsl_link_id_is_sacch(uint8_t link_id)
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 @@ static int rslms_get_meas_msg_type(struct msgb *msg, bool rllh_link_id_is_sacch)
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 @@ static int rslms_get_meas_msg_type(struct msgb *msg, bool rllh_link_id_is_sacch)
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 */