system_information: Fix BCCH Allocation when only 1 BTS present
The current code used the variable bitmap format, but that's not possible since in this format the base ARFCN is part of the set. That lead to a neighbor list containing ARFCN 0. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
d6c35f6e8a
commit
42a5652eb2
|
@ -98,7 +98,7 @@ static int freq_list_bmrel_set_arfcn(u_int8_t *chan_list, unsigned int arfcn)
|
|||
static int bitvec2freq_list(u_int8_t *chan_list, struct bitvec *bv,
|
||||
const struct gsm_bts *bts)
|
||||
{
|
||||
int i, rc, min = 1024, max = 0;
|
||||
int i, rc, min = 1024, max = -1;
|
||||
|
||||
memset(chan_list, 0, 16);
|
||||
|
||||
|
@ -128,6 +128,12 @@ static int bitvec2freq_list(u_int8_t *chan_list, struct bitvec *bv,
|
|||
}
|
||||
}
|
||||
|
||||
if (max == -1) {
|
||||
/* Empty set, use 'bit map 0 format' */
|
||||
chan_list[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((max - min) > 111) {
|
||||
LOGP(DRR, LOGL_ERROR, "min_arfcn=%u, max_arfcn=%u, "
|
||||
"distance > 111\n", min, max);
|
||||
|
|
Loading…
Reference in New Issue