diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2022-02-17 23:10:08 +0100 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2022-02-22 16:32:17 +0100 |
commit | e561e74bfec8e6d928755766491bf6906c1aa9b9 (patch) | |
tree | 6def1480c0d63d904887c8f5e69750a9f35a2253 /src/osmo-bsc/abis_rsl.c | |
parent | a9e5c016fc40d8632340a7d359954f9a701c0dcd (diff) |
rename RSL_ENC_ALG_A5 to ALG_A5_NR_TO_RSL, clarify
The naming confused me so that I wrote buggy code again. Hopefully this
clarifies which representations the code paths are using.
In the macro code, highlight the error case of n <= -1 explicitly.
Also add ALG_A5_NR_TO_PERM_ALG_BITS. I need the 1<<n case in an
upcoming patch.
Related: SYS#5839
Change-Id: I7557ae97764bba09c906748a18e9031dfb362611
Diffstat (limited to 'src/osmo-bsc/abis_rsl.c')
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 402ea27bc..a49cc6529 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -660,7 +660,7 @@ int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t ho_ref) msg->l3h = len + 1; *len = msgb_l3len(msg); - if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) { + if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) { uint8_t encr_info[MAX_A5_KEY_LEN+2]; rc = build_encr_info(encr_info, lchan); if (rc > 0) @@ -764,7 +764,7 @@ int rsl_chan_mode_modify_req(struct gsm_lchan *lchan) msgb_tlv_put(msg, RSL_IE_CHAN_MODE, sizeof(cm), (uint8_t *) &cm); - if (lchan->encr.alg_id > RSL_ENC_ALG_A5(0)) { + if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) { uint8_t encr_info[MAX_A5_KEY_LEN+2]; rc = build_encr_info(encr_info, lchan); if (rc > 0) |