diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-01-25 18:59:42 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-02-19 08:38:21 +0000 |
commit | bf1fea0928183f51e994c3f2b0e0f0ca831fd7b8 (patch) | |
tree | e52f155143772553ddd2006e00dc4e43072cab94 /src/common/rsl.c | |
parent | efa55a454174da12a44c750377b3605d9bfbf7ef (diff) |
rsl: do not allow MODE MODIFY request with unsupp. codec/rate
When the BSC sends a MODE MODIFY request with an unsupported
codec, the BTS must respond with a negative acknowledge.
Currently the codec parameter is not checked at all, which may
lead into malfunction or crash of the BTS.
- Introduce a mechanism to check the codec/rate against a
table that is set up in the phy specific code.
- Add tables with supported codec/rate combinations for
octphy, sysmobts, and trx.
Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023
Related: SYS#3212
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r-- | src/common/rsl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c index 3d0993c3..2eb0db1d 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1278,6 +1278,7 @@ static int rsl_rx_mode_modif(struct msgb *msg) struct gsm_lchan *lchan = msg->lchan; struct rsl_ie_chan_mode *cm; struct tlv_parsed tp; + struct gsm_bts_role_bts *btsb = bts_role_bts(lchan->ts->trx->bts); rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)); @@ -1289,6 +1290,11 @@ static int rsl_rx_mode_modif(struct msgb *msg) cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE); lchan_tchmode_from_cmode(lchan, cm); + if (bts_supports_cm(btsb, lchan->ts->pchan, lchan->tch_mode) != 1) { + LOGP(DRSL, LOGL_ERROR, "invalid mode/codec instructed by BSC, check BSC configuration.\n"); + return rsl_tx_mode_modif_nack(lchan, RSL_ERR_SERV_OPT_UNAVAIL); + } + /* 9.3.7 Encryption Information */ if (TLVP_PRESENT(&tp, RSL_IE_ENCR_INFO)) { uint8_t len = TLVP_LEN(&tp, RSL_IE_ENCR_INFO); |