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
This commit is contained in:
Philipp Maier 2019-01-17 13:41:17 +01:00
parent 09273b7f19
commit f165e338b5
1 changed files with 5 additions and 1 deletions

View File

@ -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;