pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40571?usp=email )
Change subject: Improve error log when adding >16 ASPs to an AS ......................................................................
Improve error log when adding >16 ASPs to an AS
Change-Id: Id9d13e6de24acd6465a099052a48c8b322a8f245 --- M src/ss7_as.c M src/ss7_as_vty.c 2 files changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/71/40571/1
diff --git a/src/ss7_as.c b/src/ss7_as.c index fac5ffe..16da09f 100644 --- a/src/ss7_as.c +++ b/src/ss7_as.c @@ -169,6 +169,7 @@ } }
+ LOGPAS(as, DLSS7, LOGL_ERROR, "Failed adding ASP %s to AS, ASP table is full!\n", asp->cfg.name); return -ENOSPC; }
diff --git a/src/ss7_as_vty.c b/src/ss7_as_vty.c index c34bbed..6ea170e 100644 --- a/src/ss7_as_vty.c +++ b/src/ss7_as_vty.c @@ -110,9 +110,15 @@ CMD_ATTR_IMMEDIATE) { struct osmo_ss7_as *as = vty->index; + int rc = osmo_ss7_as_add_asp(as, argv[0]);
- if (osmo_ss7_as_add_asp(as, argv[0])) { - vty_out(vty, "cannot find ASP '%s'%s", argv[0], VTY_NEWLINE); + if (rc < 0) { + if (rc == -ENODEV) + vty_out(vty, "%% Cannot find ASP '%s'%s", argv[0], VTY_NEWLINE); + else if (rc == -ENOSPC) + vty_out(vty, + "%% Cannot associate ASP '%s' to AS '%s': ASP table for the AS is full!%s", + argv[0], as->cfg.name, VTY_NEWLINE); return CMD_WARNING; }