diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-28 17:09:29 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-28 18:01:47 +0800 |
commit | 4049455d744455dd48fa359a220822303fc3a5be (patch) | |
tree | 262a428bb44471ee7d7ddbdf89421633ba409392 /openbsc/src/bsc_api.c | |
parent | 2412a07965ace5fc425b401438d21ff86ceeb2df (diff) |
bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
* Errors via the clear_request callback...
* no more transactions and operations are going on.
This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
Diffstat (limited to 'openbsc/src/bsc_api.c')
-rw-r--r-- | openbsc/src/bsc_api.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c index 92fe66118..46a3343e0 100644 --- a/openbsc/src/bsc_api.c +++ b/openbsc/src/bsc_api.c @@ -104,13 +104,20 @@ int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id) if (rc != BSC_API_CONN_POL_ACCEPT) { subscr_con_free(lchan->conn); - lchan_auto_release(lchan); + lchan_release(lchan, 0, 0); } } return 0; } +int gsm0808_clear(struct gsm_subscriber_connection* conn) +{ + subscr_con_free(conn); + lchan_release(conn->lchan, 1, 0); + return 0; +} + static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id) { struct bsc_api *api; @@ -155,12 +162,12 @@ static int bsc_handle_lchan_signal(unsigned int subsys, unsigned int signal, if (!lchan || !lchan->conn) return 0; - bsc = lchan->ts->trx->bts->network->bsc_api; if (!bsc || !bsc->clear_request) return 0; bsc->clear_request(lchan->conn, 0); + subscr_con_free(lchan->conn); return 0; } |