aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-09-11 10:46:56 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-11 20:39:20 +0200
commit8e5a66cb28149447a2b9668efcc4156c53d6d614 (patch)
tree04efb058a2dae840175f1b94f81f42b77c19d98c
parent3ec9fd4fb0208c943224b2fc6c1c64cbcc714823 (diff)
vty: Hide unconfigured BTS on 'write'
This prevents the application from crashing when there is a half configured BTS (e.g. by using the command 'bts 1' when there isn't a BTS 1) and the 'write' command is used. Conflicts: openbsc/tests/vty_test_runner.py
-rw-r--r--openbsc/src/libbsc/bsc_vty.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 1a83e7669..19fe6b3be 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -583,11 +583,13 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
if (bts->excl_from_rf_lock)
vty_out(vty, " rf-lock-exclude%s", VTY_NEWLINE);
- if (bts->model->config_write_bts)
- bts->model->config_write_bts(vty, bts);
+ if (bts->model) {
+ if (bts->model->config_write_bts)
+ bts->model->config_write_bts(vty, bts);
- llist_for_each_entry(trx, &bts->trx_list, list)
- config_write_trx_single(vty, trx);
+ llist_for_each_entry(trx, &bts->trx_list, list)
+ config_write_trx_single(vty, trx);
+ }
}
static int config_write_bts(struct vty *v)