diff options
authorHarald Welte <laforge@gnumonks.org>2018-05-09 20:02:12 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-09 18:55:59 +0000
commit8b70d9f7497a6ab57ca938d25d58e1e53b146d93 (patch)
parent09e49eed6181cea145cd08c65c87986a6e033be9 (diff)
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
1 files changed, 1 insertions, 1 deletions
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 */