diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-06-04 17:34:02 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-08-25 23:16:45 +0200 |
commit | ddb93a6e5eaf62c7cfb8339fc3e04bf56a1bedd8 (patch) | |
tree | 005f7b43746ede9e0bc9cb44c663db968c53be21 /openbsc/src | |
parent | 6d447a765ebff8485113b98451ddf18d7a69a937 (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')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_msc.c | 2 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 35d504ec3..0ee83121f 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -411,7 +411,7 @@ static void initialize_if_needed(struct bsc_msc_connection *conn) return; } - sccp_write(msg, &sccp_ssn_bssap, &sccp_ssn_bssap, 0, NULL); + sccp_write(msg, &sccp_ssn_bssap, &sccp_ssn_bssap, 0, conn); msgb_free(msg); conn->is_authenticated = 1; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index fbc4ff99a..b5ab67ff1 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) |