aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-01-17 13:41:17 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2019-01-21 16:57:02 +0100
commitf165e338b52b310a8d1e1c6b0ecdf1f966daf754 (patch)
treef600c74958fe80cf7b1b80473ee2054186929075
parent09273b7f196b0b688552229f1b70c2b6e0806bf2 (diff)
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
-rw-r--r--src/osmo-bsc/lchan_select.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index f70ad4a..b63dcd2 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;