aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-06-04 17:34:02 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-03-16 11:56:10 +0100
commit44e5dad3e25ed8aa200bd6229f2d4d94b8326123 (patch)
tree732902eb51d38e0d9641729f3732be262317c928 /openbsc/src/osmo-bsc/osmo_bsc_sccp.c
parentabd668a68d2f7d948b39cf90b04b519f91367a98 (diff)
bsc: Use the right connection for outgoing packets
This is needed for simple UDT messages where we do not have a SCCP connection.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_sccp.c')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_sccp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index 529b488db..6ac300739 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
@@ -140,8 +140,16 @@ static void sccp_cc_timeout(void *_data)
static void msc_sccp_write_ipa(struct sccp_connection *conn, struct msgb *msg,
void *global_ctx, void *ctx)
{
- struct gsm_network *net = (struct gsm_network *) global_ctx;
- msc_queue_write(net->bsc_data->msc.msc_con, msg, IPAC_PROTO_SCCP);
+ struct bsc_msc_connection *msc_con;
+
+ if (conn) {
+ struct osmo_bsc_sccp_con *bsc_con = conn->data_ctx;
+ msc_con = bsc_con->msc->msc_con;
+ } else {
+ msc_con = ctx;
+ }
+
+ msc_queue_write(msc_con, msg, IPAC_PROTO_SCCP);
}
static int msc_sccp_accept(struct sccp_connection *connection, void *data)