fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32150 )
Change subject: bts_earfcn_add(): do not add duplicate EARFCNs ......................................................................
bts_earfcn_add(): do not add duplicate EARFCNs
We don't want to have duplicate EARFCNs in the config file. The desired behavior is modifying existing EARFCNs.
Change-Id: Ia2fd8bd86d9f093967c1b0b0135151d2d5386dc1 Related: SYS#6401 --- M src/osmo-bsc/system_information.c M tests/si2quater_neighbor_list.vty 2 files changed, 21 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/32150/1
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index cfc9a04..9f33413 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -220,7 +220,14 @@ uint8_t qrx, uint8_t meas_bw) { struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; - int r = osmo_earfcn_add(e, earfcn, (meas_bw < EARFCN_MEAS_BW_INVALID) ? meas_bw : OSMO_EARFCN_MEAS_INVALID); + int r; + + /* EARFCN may already exist, so we delete it to avoid duplicates */ + osmo_earfcn_del(e, earfcn); + if (meas_bw < EARFCN_MEAS_BW_INVALID) + r = osmo_earfcn_add(e, earfcn, meas_bw); + else + r = osmo_earfcn_add(e, earfcn, OSMO_EARFCN_MEAS_INVALID);
if (r < 0) return r; diff --git a/tests/si2quater_neighbor_list.vty b/tests/si2quater_neighbor_list.vty index 6aeb5f5..89ca94d 100644 --- a/tests/si2quater_neighbor_list.vty +++ b/tests/si2quater_neighbor_list.vty @@ -75,14 +75,12 @@ ... !si2quater neighbor-list
OsmoBSC(config-net-bts)# ### EARFCN add command: EARFCN already exists -OsmoBSC(config-net-bts)# ### FIXME: osmo-bsc adds a duplicate EARFCN OsmoBSC(config-net-bts)# si2quater neighbor-list add earfcn 300 thresh-hi 7 thresh-lo 5 prio 5 qrxlv 6 meas 2 OsmoBSC(config-net-bts)# show running-config ... bts 0 ... !si2quater neighbor-list si2quater neighbor-list add earfcn 0 thresh-hi 7 thresh-lo 5 prio 5 qrxlv 6 meas 8 - si2quater neighbor-list add earfcn 300 thresh-hi 7 thresh-lo 5 prio 5 qrxlv 6 meas 5 si2quater neighbor-list add earfcn 300 thresh-hi 7 thresh-lo 5 prio 5 qrxlv 6 meas 2 ... !si2quater neighbor-list