diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-12-22 23:17:50 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-01-01 17:23:42 +0100 |
commit | 371efe5955cc23765e63f658c792725dd5e5066a (patch) | |
tree | 41752deda5f0dfbb0101d2e36eee5e5e6bc385d7 /openbsc | |
parent | 49a2ddeec016a8784a7e3c0265a1a77f4480d9dc (diff) |
mncc_sock: Clear all calls if MNCC application (LCR) disconnects
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/gsm_04_08.h | 1 | ||||
-rw-r--r-- | openbsc/src/gsm_04_08.c | 12 | ||||
-rw-r--r-- | openbsc/src/mncc_sock.c | 4 |
3 files changed, 16 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h index 88d43cd65..1c879edce 100644 --- a/openbsc/include/openbsc/gsm_04_08.h +++ b/openbsc/include/openbsc/gsm_04_08.h @@ -25,6 +25,7 @@ static inline struct msgb *gsm48_msgb_alloc(void) /* config options controlling the behaviour of the lower leves */ void gsm0408_allow_everyone(int allow); void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); +void gsm0408_clear_all_trans(struct gsm_network *net, int protocol); int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg); int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id); diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index 634eed335..4ab61ba89 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -329,6 +329,18 @@ void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t caus } } +void gsm0408_clear_all_trans(struct gsm_network *net, int protocol) +{ + struct gsm_trans *trans, *temp; + + LOGP(DCC, LOGL_NOTICE, "Clearing all currently active transactions!!!\n"); + + llist_for_each_entry_safe(trans, temp, &net->trans_list, entry) { + if (trans->protocol == protocol) + trans_free(trans); + } +} + /* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, u_int8_t cause) { diff --git a/openbsc/src/mncc_sock.c b/openbsc/src/mncc_sock.c index be0d9b933..7e0a2088c 100644 --- a/openbsc/src/mncc_sock.c +++ b/openbsc/src/mncc_sock.c @@ -66,7 +66,9 @@ static void mncc_sock_close(struct mncc_sock_state *state) state->listen_bfd.when |= BSC_FD_READ; /* FIXME: make sure we don't enqueue anymore */ - /* FIXME: release all exisitng calls */ + + /* release all exisitng calls */ + gsm0408_clear_all_trans(state->net, GSM48_PDISC_CC); /* flush the queue */ while (!llist_empty(&state->net->upqueue)) { |