From f2553a6c3a9c677f71fd7f123c54d80a915f7a0a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 30 Jun 2010 12:58:14 +0800 Subject: handover: Call bsc_handover_clear from gsm0808_clear The bsc_handover_clear will release an in-progress handover and free the lchana and the data associated with this handover --- openbsc/src/handover_logic.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'openbsc/src/handover_logic.c') diff --git a/openbsc/src/handover_logic.c b/openbsc/src/handover_logic.c index 42dc5d8e6..cdb066447 100644 --- a/openbsc/src/handover_logic.c +++ b/openbsc/src/handover_logic.c @@ -149,6 +149,30 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) return 0; } +void bsc_clear_handover(struct gsm_subscriber_connection *conn) +{ + struct bsc_handover *ho; + + ho = bsc_ho_by_new_lchan(conn->ho_lchan); + + + if (!ho && conn->ho_lchan) + LOGP(DHO, LOGL_ERROR, "BUG: We lost some state.\n"); + + if (!ho) { + LOGP(DHO, LOGL_ERROR, "unable to find HO record\n"); + return; + } + + conn->ho_lchan->conn = NULL; + conn->ho_lchan = NULL; + lchan_release(ho->new_lchan, 0, 1); + + bsc_del_timer(&ho->T3103); + llist_del(&ho->list); + talloc_free(ho); +} + /* T3103 expired: Handover has failed without HO COMPLETE or HO FAIL */ static void ho_T3103_cb(void *_ho) { -- cgit v1.2.3