rsl: Make channel activation fail if encryption algorithm not supported

The code actually always *wanted* to make lchan activation fail in
case we don't support the algorithm, but it failed ot do so.

The problem is encr_info2lchan() which uses bts_supports_cipher() to
determine if the cipher is supported. However, if bts_supports_cipher()
returns 0 (not supported), it uses this value as return value of
encr_info2lchan() where '0' means success (standard osmocom convention).
This results in channel activation proceeding, which it shouldn't.

Change-Id: I46275b8fc2a1a74f68b4cc60e0f64ba226b108cd
Related: OS#3254
This commit is contained in:
Harald Welte 2018-05-09 20:02:12 +02:00
parent 09e49eed61
commit 8b70d9f749
1 changed files with 1 additions and 1 deletions

View File

@ -871,7 +871,7 @@ static int encr_info2lchan(struct gsm_lchan *lchan,
if (rc != 1) {
LOGP(DRSL, LOGL_ERROR, "%s: BTS doesn't support cipher 0x%02x\n",
gsm_lchan_name(lchan), *val);
return rc;
return -EINVAL;
}
/* length can be '1' in case of no ciphering */