[MERGED] osmo-bsc[master]: osmo-bsc vty: be fatal for addressbook entry errors

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Nov 10 23:36:02 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: osmo-bsc vty: be fatal for addressbook entry errors
......................................................................


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
---
M src/osmo-bsc/osmo_bsc_vty.c
1 file changed, 8 insertions(+), 10 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index ca47097..0003cfa 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -724,18 +724,17 @@
 
 	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 @@
 
 	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;
 		}
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/4727
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list