From 380831e678d0cf6721bcc8389cc760a0370f7b5a Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 15 Sep 2020 11:41:47 +0200 Subject: gsm 04.08: correct calculate the Cell Selection Indicator after release of all TCH and SDCCH When the measurement bandwidth was added the calculation of the maximum length wasn't increased. Fixes: 27a887f666ad ("gsm 04.08: encode the LTE neighbors measurement bandwindth in Channel Release") Change-Id: Ic8132fd988140c34b8e0fd8349f4518fcbaecc31 --- src/osmo-bsc/gsm_04_08_rr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index c2f430463..a7bba0d4e 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -239,8 +239,8 @@ static void mr_config_for_ms(struct gsm_lchan *lchan, struct msgb *msg) lchan->mr_ms_lv + 1); } - -#define CELL_SEL_IND_AFTER_REL_MAX_BITS (3+MAX_EARFCN_LIST*20+1) +#define CELL_SEL_IND_AFTER_REL_EARCFN_ENTRY (1+16+4+1+1) +#define CELL_SEL_IND_AFTER_REL_MAX_BITS (3+MAX_EARFCN_LIST*CELL_SEL_IND_AFTER_REL_EARCFN_ENTRY+1) #define CELL_SEL_IND_AFTER_REL_MAX_BYTES OSMO_BYTES_FOR_BITS(CELL_SEL_IND_AFTER_REL_MAX_BITS) /* Generate a CSN.1 encoded "Cell Selection Indicator after release of all TCH and SDCCH" @@ -263,8 +263,8 @@ static int generate_cell_sel_ind_after_rel(uint8_t *out, unsigned int out_len, c if (e->arfcn[i] == OSMO_EARFCN_INVALID) continue; - /* tailroom must fit one more EARFCN (20 bits), plus the final list term bit. */ - if (bitvec_tailroom_bits(&bv) < 21) { + /* tailroom must fit one more EARFCN plus the final list term bit. */ + if (bitvec_tailroom_bits(&bv) < CELL_SEL_IND_AFTER_REL_EARCFN_ENTRY + 1) { LOGP(DRR, LOGL_NOTICE, "%s: Not enough room to store EARFCN %u in the " "Cell Selection Indicator IE\n", gsm_bts_name(bts), e->arfcn[i]); } else { -- cgit v1.2.3