aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-14 15:26:07 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-19 17:06:57 +0100
commit1a87c1b1891262e063d3bc862a8a1babef943f74 (patch)
treea9bcc96b3388475317ccee6aba4e1a684255b2b0
parentcc6ac4cdc4103cb68a3e161deb49dfb64c931adf (diff)
LaPDm: Refuse SUSPEND/RESUME/RECONNECT in BTS mode
The primitives for SUSPEND, RESUME and RECONNECT are only permitted on the MS side of the LAPDm link, not on the BTS side. So we should check for this and reject, accordingly.
-rw-r--r--src/gsm/lapdm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index 54d3a0b8..d44335fe 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -1092,6 +1092,23 @@ static int rslms_rx_rll(struct msgb *msg, struct lapdm_channel *lc)
else
le = &lc->lapdm_dcch;
+ /* 4.1.1.5 / 4.1.1.6 / 4.1.1.7 all only exist on MS side, not
+ * BTS side */
+ if (le->mode == LAPDM_MODE_BTS) {
+ switch (msg_type) {
+ case RSL_MT_SUSP_REQ:
+ case RSL_MT_RES_REQ:
+ case RSL_MT_RECON_REQ:
+ LOGP(DLLAPD, LOGL_NOTICE, "(%p) RLL Message '%s' unsupported in BTS side LAPDm\n",
+ lc->name, rsl_msg_name(msg_type));
+ msgb_free(msg);
+ return -EINVAL;
+ break;
+ default:
+ break;
+ }
+ }
+
/* G.2.1 No action shall be taken on frames containing an unallocated
* SAPI.
*/