aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-03-01 17:35:42 +0100
committerHarald Welte <laforge@gnumonks.org>2019-03-19 13:29:10 +0000
commit0e5a3c5ffd4d9fcb1a1e07fc8bc28e8fb30cd4e8 (patch)
treed0a1cc5ac4a9cfa3afd43a9678a45a34ecc6adb1 /src/osmo-bsc
parentcf5d0c7f636e7cfb9d5deb37a7734b11b5efb5bc (diff)
lchan_fsm: make sure multi rate configuration is valid
When gsm48_mr_cfg_from_gsm0808_sc_cfg() is used to generate the AMR multirate configuration IE, make sure that lchan allocation fails in cases where the multirate configuration IE can not be generated. Change-Id: Icd3e5674b10b8ae223c0d13ae33fc9ae7e8a8a18 Depends: libosmocore I6fd7f4073b84093742c322752f2fd878d1071e15 Related: SYS#4470
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/lchan_fsm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 8b4cf6d7b..0c54efb6d 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -539,7 +539,12 @@ static void lchan_fsm_wait_ts_ready_onenter(struct osmo_fsm_inst *fi, uint32_t p
}
if (info->chan_mode == GSM48_CMODE_SPEECH_AMR) {
- gsm48_mr_cfg_from_gsm0808_sc_cfg(&mr_conf, info->s15_s0);
+ if (gsm48_mr_cfg_from_gsm0808_sc_cfg(&mr_conf, info->s15_s0) < 0) {
+ lchan_fail("Can not determine multirate configuration, S15-S0 (%04x) are ambiguous!\n",
+ info->s15_s0);
+ return;
+ }
+
if (lchan_mr_config(lchan, &mr_conf) < 0) {
lchan_fail("Can not generate multirate configuration IE\n");
return;