diff options
author | Harald Welte <laforge@osmocom.org> | 2021-04-25 15:08:24 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-04-26 13:06:57 +0200 |
commit | 6b799aeb67c09ce4c4b9e531afb0bcc7093ebd37 (patch) | |
tree | 28cbfbb206c3cf5e4a0a739bd541c1118a28e0b9 | |
parent | 37a3b1f07dc959c21db2b7bcebae842ecf88b054 (diff) |
Don't create duplicate routes in osmo_ss7_route_create()
Let's refuse to create exactly identical routes
Change-Id: I520415d4499a4017dfdbdfc3cd67522e1bbd1627
Related: SYS#5422
-rw-r--r-- | src/osmo_ss7.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; |