aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-07 00:03:02 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-15 20:06:49 +0100
commitaf4b5fb13e3615410fed1b78a3f2a7cbf2d7ed0b (patch)
tree62b345361c01d65810433d123754a99764de6c82 /openbsc/src/bsc
parent57d304871e678a8da6a9191e52764cec569bdfb3 (diff)
bsc: Implement clearing the SCCP connection
Diffstat (limited to 'openbsc/src/bsc')
-rw-r--r--openbsc/src/bsc/osmo_bsc_sccp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/bsc/osmo_bsc_sccp.c b/openbsc/src/bsc/osmo_bsc_sccp.c
index 6fc686906..cc381bcda 100644
--- a/openbsc/src/bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/bsc/osmo_bsc_sccp.c
@@ -46,6 +46,22 @@ static void msc_outgoing_sccp_data(struct sccp_connection *conn,
static void msc_outgoing_sccp_state(struct sccp_connection *conn, int old_state)
{
+ struct osmo_bsc_sccp_con *con_data;
+
+ if (conn->connection_state >= SCCP_CONNECTION_STATE_RELEASE_COMPLETE) {
+ con_data = (struct osmo_bsc_sccp_con *) conn->data_ctx;
+ if(con_data->conn) {
+ LOGP(DMSC, LOGL_ERROR,
+ "ERROR: The lchan is still associated\n.");
+ gsm0808_clear(con_data->conn);
+ subscr_con_free(con_data->conn);
+ con_data->conn = NULL;
+ }
+
+ con_data->sccp = NULL;
+ sccp_connection_free(conn);
+ bsc_delete_connection(con_data);
+ }
}
static void bsc_sccp_force_free(struct osmo_bsc_sccp_con *data)