aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-08-09 18:43:03 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-08-09 19:01:22 +0200
commitbb8329e91c09a180733716fcdf0c24c4facd5cc9 (patch)
treecca40fc07ef04a194b1ea5c90ca06e4128d95839
parent9d1a3f66457508e16dd2d1d33fe7bf5ed24b633b (diff)
sccp: fix creating of the default route in simple client
The simple client (osmo_sccp_simple_client_on_ss7_id() and osmo_sccp_simple_client) does not create a default route if the user has already created an AS via VTY. Check the presence of a default route independently of the AS. If no default route exists, create one. Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a
-rw-r--r--src/sccp_user.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 1414572..1d59d3c 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -368,16 +368,20 @@ osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
goto out_ss7;
}
as->cfg.routing_key.pc = ss7->cfg.primary_pc;
+ }
+ LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name,
+ as->cfg.name);
- /* install default route */
+ /* Create a default route if necessary */
+ rt = osmo_ss7_route_find_dpc_mask(ss7->rtable_system, 0, 0);
+ if (!rt) {
+ LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating default route\n", name);
rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0,
as->cfg.name);
if (!rt)
goto out_as;
rt_created = true;
}
- LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name,
- as->cfg.name);
/* Check if we do already have an application server process
* that is associated with the application server we have choosen