Change in libosmo-sccp[master]: Don't create duplicate routes in osmo_ss7_route_create()

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

laforge gerrit-no-reply at lists.osmocom.org
Sun Apr 25 13:09:24 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/23890 )


Change subject: Don't create duplicate routes in osmo_ss7_route_create()
......................................................................

Don't create duplicate routes in osmo_ss7_route_create()

Let's refuse to create exactly identical routes

Change-Id: I520415d4499a4017dfdbdfc3cd67522e1bbd1627
Related: SYS#5422
---
M src/osmo_ss7.c
1 file changed, 9 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 5ff4ca4..f8e12e7 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -783,6 +783,15 @@
 			return NULL;
 	}
 
+	/* check for duplicates */
+	rt = osmo_ss7_route_find_dpc_mask(rtbl, pc, mask);
+	if (rt && !strcmp(rt->cfg.linkset_name, linkset_name)) {
+		LOGSS7(rtbl->inst, LOGL_ERROR, "Refusing to create duplicate route: "
+			"pc=%u=%s mask=0x%x via linkset/AS '%s'\n",
+			pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, linkset_name);
+		return NULL;
+	}
+
 	rt = talloc_zero(rtbl, struct osmo_ss7_route);
 	if (!rt)
 		return NULL;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/23890
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I520415d4499a4017dfdbdfc3cd67522e1bbd1627
Gerrit-Change-Number: 23890
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210425/d39004c1/attachment.htm>


More information about the gerrit-log mailing list