aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-07-19 12:45:39 +0200
committerdexter <pmaier@sysmocom.de>2017-07-26 15:14:49 +0000
commitb06c887cf0ae8b0dd15f93f85459cf903f3b145b (patch)
tree2b87b5f163088af07c4fbd87e5a5c08484484363
parentdcb360a9dbd418ac582b2996cf394390b154fe0a (diff)
sccp: ensure addressbook entry names are unique
It is possible to add two (or more) different sccp-addresses under the same name, when the addresses are defined in different cs7 instances. Add a check to make sure an address name is not used multiple times Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335
-rw-r--r--src/osmo_ss7_vty.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 8a03303..c859eb9 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1205,6 +1205,16 @@ DEFUN(cs7_sccpaddr, cs7_sccpaddr_cmd,
return CMD_WARNING;
}
+ /* Ensure that we do not use address names that
+ * are already used in other ss7 instances. */
+ 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;
+ }
+
entry = addr_entry_by_name_local(name, inst);
/* Create a new addressbook entry if we can not find an