laforge submitted this change.

View Change


Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
si2quater: bts_uarfcn_add(): modify existsing UARFCNs

Do not print an error, modify the existsing UARFCNs instead.

Change-Id: Iadc884aa8968e2dc01adf26ba68ba9597fa05d94
Related: SYS#6401
---
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/system_information.c
M tests/si2quater_neighbor_list.vty
3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index 30f9c72..0ecb6d6 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -2127,10 +2127,6 @@
vty_out(vty, "%% Warning: not enough space in SI2quater for a given UARFCN (%u, %u)%s",
arfcn, scramble, VTY_NEWLINE);
return CMD_WARNING;
- case -EADDRINUSE:
- vty_out(vty, "%% Unable to add UARFCN: (%u, %u) is already added%s",
- arfcn, scramble, VTY_NEWLINE);
- return CMD_WARNING;
}

return CMD_SUCCESS;
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c
index c6928d6..58f732c 100644
--- a/src/osmo-bsc/system_information.c
+++ b/src/osmo-bsc/system_information.c
@@ -302,8 +302,13 @@
*ual = bts->si_common.data.uarfcn_list,
*scl = bts->si_common.data.scramble_list;

- if (pos >= 0)
- return -EADDRINUSE;
+ if (pos >= 0) {
+ LOGP(DRR, LOGL_NOTICE,
+ "EARFCN (%u, %u) is already in the list, modifying\n",
+ arfcn, scramble);
+ scl[pos] = scr;
+ return 0;
+ }

if (len == MAX_EARFCN_LIST)
return -ENOMEM;
diff --git a/tests/si2quater_neighbor_list.vty b/tests/si2quater_neighbor_list.vty
index dbb8d2a..ea353f2 100644
--- a/tests/si2quater_neighbor_list.vty
+++ b/tests/si2quater_neighbor_list.vty
@@ -148,11 +148,16 @@
... !si2quater neighbor-list


-OsmoBSC(config-net-bts)# ### Adding duplicate UARFCN is not allowed
+OsmoBSC(config-net-bts)# ### UARFCN add command: UARFCN already exists
OsmoBSC(config-net-bts)# si2quater neighbor-list add uarfcn 111 511 1
-% Unable to add UARFCN: (111, 511) is already added
OsmoBSC(config-net-bts)# si2quater neighbor-list add uarfcn 111 511 0
-% Unable to add UARFCN: (111, 511) is already added
+OsmoBSC(config-net-bts)# show running-config
+...
+ bts 0
+... !si2quater neighbor-list
+ si2quater neighbor-list add uarfcn 111 511 0
+ si2quater neighbor-list add uarfcn 111 211 1
+... !si2quater neighbor-list


OsmoBSC(config-net-bts)# ### FIXME: UARFCN 0 cannot be added

To view, visit change 32201. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iadc884aa8968e2dc01adf26ba68ba9597fa05d94
Gerrit-Change-Number: 32201
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged