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

laforge gerrit-no-reply at lists.osmocom.org
Mon Apr 26 11:15:52 UTC 2021


laforge has submitted this change. ( 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(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 7021fa8..98dfc0c 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 rt;
+	}
+
 	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: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210426/47980df1/attachment.htm>


More information about the gerrit-log mailing list