aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-11-08 03:03:13 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-11-09 01:17:33 +0000
commit46e87509c555cd15f1bf10b6ec0fc1aae2b90376 (patch)
treed95fcbc65d0c5ce6eddb6d2aa029a7db2f156907 /src/osmo-bsc
parentd317d6d60815509ee78b68a6d40dd630cfa3ce47 (diff)
osmo-bsc vty: be fatal for addressbook entry errors
So far, the config would log an error upon config parsing, and then continue to use defaults, which is super easy to miss. On errors, return CMD_ERR_INCOMPLETE to abort the program in a config parsing error. Be fatal for non-existing addressbook entries and for using address book entries from mismatching cs7 instances. Though it is mixing in cosmetic changes, add "Error:" to the output and arrange the erratic name to the end of the message, as is customary for error messages. Related: libosmo-sccp I2f71b9c4dd30f919d2054da81283dd7035f44f60 Change-Id: Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/osmo_bsc_vty.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index ca4709759..0003cfa0d 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -724,18 +724,17 @@ DEFUN(cfg_msc_cs7_bsc_addr,
ss7 = osmo_sccp_addr_by_name(&msc->a.bsc_addr, bsc_addr_name);
if (!ss7) {
- vty_out(vty, "No sccp address %s found%s", bsc_addr_name,
- VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Error: No such SCCP addressbook entry: '%s'%s", bsc_addr_name, VTY_NEWLINE);
+ return CMD_ERR_INCOMPLETE;
}
/* Prevent mixing addresses from different CS7/SS7 instances */
if (msc->a.cs7_instance_valid) {
if (msc->a.cs7_instance != ss7->cfg.id) {
vty_out(vty,
- "SCCP address %s from different CS7 instance%s",
+ "Error: SCCP addressbook entry from mismatching CS7 instance: '%s'%s",
bsc_addr_name, VTY_NEWLINE);
- return CMD_WARNING;
+ return CMD_ERR_INCOMPLETE;
}
}
@@ -757,18 +756,17 @@ DEFUN(cfg_msc_cs7_msc_addr,
ss7 = osmo_sccp_addr_by_name(&msc->a.msc_addr, msc_addr_name);
if (!ss7) {
- vty_out(vty, "No sccp address %s found%s", msc_addr_name,
- VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Error: No such SCCP addressbook entry: '%s'%s", msc_addr_name, VTY_NEWLINE);
+ return CMD_ERR_INCOMPLETE;
}
/* Prevent mixing addresses from different CS7/SS7 instances */
if (msc->a.cs7_instance_valid) {
if (msc->a.cs7_instance != ss7->cfg.id) {
vty_out(vty,
- "SCCP address %s from different CS7 instance%s",
+ "Error: SCCP addressbook entry from mismatching CS7 instance: '%s'%s",
msc_addr_name, VTY_NEWLINE);
- return CMD_WARNING;
+ return CMD_ERR_INCOMPLETE;
}
}