From 6b799aeb67c09ce4c4b9e531afb0bcc7093ebd37 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 25 Apr 2021 15:08:24 +0200 Subject: Don't create duplicate routes in osmo_ss7_route_create() Let's refuse to create exactly identical routes Change-Id: I520415d4499a4017dfdbdfc3cd67522e1bbd1627 Related: SYS#5422 --- src/osmo_ss7.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 @@ osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t pc, 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; -- cgit v1.2.3