aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2021-02-18 01:32:10 +0100
committerKeith <keith@rhizomatica.org>2021-02-19 08:29:32 +0100
commite4b52dff395dc7fbb856dade1d7f0c336832b2c3 (patch)
tree8b1479f7f31d9a93c452b46cc0d8915dec1e01df
parentcdbd7e3bf29fe39637ed1cc07c6750197ad39444 (diff)
Disallow changing the type of an existing BTS from the vty
Changing the BTS type is not supported, so don't allow it. For example, Changing from type sysmobts to type rbs2000 may hit an OSMO_ASSERT in om2k_bts_fsm_alloc() The default BTS type if osmo-bsc is started with an empty configuration and the operator issues config terminal->network->bts 0 will be "unknown". This type and only this type can be changed from the vty config node. Change-Id: I0df97ef128a1bbd84c787654d1d842dce4dad819
-rw-r--r--src/osmo-bsc/bsc_vty.c3
-rw-r--r--src/osmo-bsc/bts.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index d3f8a73a4..c8dfa8d33 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -2333,6 +2333,9 @@ DEFUN_USRATTR(cfg_bts_type,
int rc;
rc = gsm_set_bts_type(bts, str2btstype(argv[0]));
+ if (rc == -EBUSY)
+ vty_out(vty, "%% Changing the type of an existing BTS is not supported.%s",
+ VTY_NEWLINE);
if (rc < 0)
return CMD_WARNING;
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 548d72484..1d0979d94 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -492,6 +492,9 @@ int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type)
{
struct gsm_bts_model *model;
+ if (bts->type != GSM_BTS_TYPE_UNKNOWN && type != bts->type)
+ return -EBUSY;
+
model = bts_model_find(type);
if (!model)
return -EINVAL;