diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-08 03:07:08 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-11-08 03:10:25 +0100 |
commit | 67ca5941407729f5a4b92ca43f7980c2b8080481 (patch) | |
tree | faafba9691eb029cae2b1f69310b167ab3750456 | |
parent | 12715e8e995b51e6d904a9dd8f4abf09fadc335c (diff) |
sccp 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 re-using an already defined addressbook entry in another cs7
instance, and for having a too long addressbook entry name.
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: osmo-bsc Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60
-rw-r--r-- | src/osmo_ss7_vty.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 2c3d78e..890fec8 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1246,8 +1246,9 @@ DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, const char *name = argv[0]; if (strlen(name) >= sizeof(entry->name)) { - vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE); - return CMD_WARNING; + vty_out(vty, "Error: SCCP address name to long: '%s'%s", + name, VTY_NEWLINE); + return CMD_ERR_INCOMPLETE; } /* Ensure that we do not use address names that @@ -1255,9 +1256,9 @@ DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd, entry = addr_entry_by_name_global(name); if (entry != NULL) { vty_out(vty, - "address name (%s) already used in ss7 instance %u%s", - entry->name, entry->inst->cfg.id, VTY_NEWLINE); - return CMD_WARNING; + "Error: SCCP address name already used in ss7 instance %u: '%s'%s", + entry->inst->cfg.id, entry->name, VTY_NEWLINE); + return CMD_ERR_INCOMPLETE; } entry = addr_entry_by_name_local(name, inst); |