summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-17 10:42:30 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-17 10:45:20 +0200
commitafc3b856135237c8ce85ca39a42da892e5bdd9de (patch)
tree2ee8f7a7d9d0c85af34a13128f699047a70fa258
parent6548d1b9c44feee0c5f38846759f396c6f5da479 (diff)
SUA: Our SUA implementation needs an SCCP instance in ss7_instance
So when we create a xua_server for SUA, we must make sure to create that associated SCCP instance, if it doesn't already exist. End-user programs probably normally call this during their initialization anyway, but in something like OsmoSTP, we need to auto-create it. Change-Id: Ib575763dbd00f5bd7bfbf48f227a8f5ef9528e2a
-rw-r--r--src/osmo_ss7.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 4aa7be5..6b77dc4 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1033,6 +1033,11 @@ osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
asp->cfg.proto = proto;
asp->cfg.name = talloc_strdup(asp, name);
llist_add_tail(&asp->list, &inst->asp_list);
+
+ /* The SUA code internally needs SCCP to work */
+ if (proto == OSMO_SS7_ASP_PROT_SUA && !inst->sccp)
+ inst->sccp = osmo_sccp_instance_create(inst, NULL);
+
}
return asp;
}
@@ -1617,6 +1622,10 @@ osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_pro
oxs->inst = inst;
llist_add_tail(&oxs->list, &inst->xua_servers);
+ /* The SUA code internally needs SCCP to work */
+ if (proto == OSMO_SS7_ASP_PROT_SUA && !inst->sccp)
+ inst->sccp = osmo_sccp_instance_create(inst, NULL);
+
return oxs;
}