From 9ef6fa079885b67a0aed14c911b104a4967beeb8 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 26 May 2019 22:40:32 +0200 Subject: 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 --- src/common/rsl.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/common/rsl.c b/src/common/rsl.c index f8c7daa2..f76a006b 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 */ -- cgit v1.2.3