[PATCH] libosmo-sccp[master]: sccp: ensure addressbook entry names are unique

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Jul 19 11:55:36 UTC 2017


Review at  https://gerrit.osmocom.org/3292

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
---
M src/osmo_ss7_vty.c
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/92/3292/1

diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index a076724..76882eb 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1199,6 +1199,15 @@
 		return CMD_WARNING;
 	}
 
+	/* Ensure that we do not use address names that
+	 * are already used in other ss7 instances. */
+	if (addr_entry_by_name(name, NULL) != NULL) {
+		vty_out(vty,
+			"address-name already used in other ss7 instance!%s",
+			VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	entry = addr_entry_by_name(name, inst);
 
 	/* Create a new addressbook entry if we can not find an

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63227cd87bc24f7d9ac995430b869f0393818335
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list