From 8b70d9f7497a6ab57ca938d25d58e1e53b146d93 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 9 May 2018 20:02:12 +0200 Subject: 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 --- src/common/rsl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/rsl.c') diff --git a/src/common/rsl.c b/src/common/rsl.c index 229d960c..f5c153a5 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -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 */ -- cgit v1.2.3