From f165e338b52b310a8d1e1c6b0ecdf1f966daf754 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 17 Jan 2019 13:41:17 +0100 Subject: lchan_select: dont allow half rate EFR to be selected The function lchan_select_by_chan_mode() is prone to select an half rate lchan when EFR is used, even though EFR is not defined for half-rate. Lets protect against that. Change-Id: I961d9aaba81424053ab1dc04ce7799e716af4cd8 Related: OS#3503 --- src/osmo-bsc/lchan_select.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index f70ad4a6e..b63dcd299 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -136,8 +136,12 @@ struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, case GSM48_CMODE_SIGN: type = GSM_LCHAN_SDCCH; break; - case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_EFR: + /* EFR works over FR channels only */ + if (!full_rate) + return NULL; + /* fall through */ + case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_AMR: type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H; break; -- cgit v1.2.3