Change in osmo-bsc[master]: Disallow changing the type of an existing BTS from the vty

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Feb 20 10:30:12 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/22964 )

Change subject: Disallow changing the type of an existing BTS from the vty
......................................................................

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
---
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index d3f8a73..c8dfa8d 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -2333,6 +2333,9 @@
 	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 548d724..1d0979d 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -492,6 +492,9 @@
 {
 	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;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/22964
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I0df97ef128a1bbd84c787654d1d842dce4dad819
Gerrit-Change-Number: 22964
Gerrit-PatchSet: 3
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210220/ec5bbb38/attachment.htm>


More information about the gerrit-log mailing list