From e67ebf0d44e71c92a5620044df44c69978e710a8 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Tue, 17 Jul 2018 16:03:07 +0200 Subject: fix handling of invalid pchan names in vty If an invalid phys_chan_config is specified in osmo-bsc.cfg, raise a parsing error at program startup. If an invalid phys_chan_config is specified in in the VTY while the program is running, show a warning to inform the user that the configuration change was not applied. Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Related: OS#1876 --- src/osmo-bsc/bsc_vty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 57c536323..77a534d51 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -4032,8 +4032,10 @@ DEFUN_HIDDEN(cfg_ts_pchan_compat, int pchanc; pchanc = gsm_pchan_parse(argv[0]); - if (pchanc < 0) - return CMD_WARNING; + if (pchanc < 0) { + vty_out(vty, "Unknown physical channel name '%s'%s", argv[0], VTY_NEWLINE); + return CMD_ERR_NO_MATCH; + } ts->pchan = pchanc; -- cgit v1.2.3