aboutsummaryrefslogtreecommitdiffstats
path: root/src/xua_asp_fsm.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-20 21:00:37 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-20 20:48:39 +0000
commit081ac9c0292298f7992916d8f1b64faf764d4174 (patch)
treeefcb36ac8965d00432d4476afb668ea95c3b420a /src/xua_asp_fsm.c
parent646f47d5a33b945397acea833b326c1e244e827a (diff)
xua_as[p]_fsm: Use osmo_timer_del() on FSM cleanup
When we destroy a FSM, we (logically) must osmo_timer_del() any running timers that the FSM might have been using. This was not implemented for xua_as_fsm, xua_asp_fsm and also missing from ipa_asp_fsm. Change-Id: I670df831d7bc30de48ed4277648a461e1e1968fa Related: OS#2668
Diffstat (limited to 'src/xua_asp_fsm.c')
-rw-r--r--src/xua_asp_fsm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 1b802ce..e81f0af 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -611,6 +611,13 @@ static int xua_asp_fsm_timer_cb(struct osmo_fsm_inst *fi)
return 0;
}
+static void xua_asp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
+{
+ struct xua_asp_fsm_priv *xafp = fi->priv;
+
+ osmo_timer_del(&xafp->t_ack.timer);
+}
+
static const struct osmo_fsm_state xua_asp_states[] = {
[XUA_ASP_S_DOWN] = {
.in_event_mask = S(XUA_ASP_E_M_ASP_UP_REQ) |
@@ -668,6 +675,7 @@ struct osmo_fsm xua_asp_fsm = {
S(XUA_ASP_E_ASPSM_BEAT) |
S(XUA_ASP_E_ASPSM_BEAT_ACK),
.allstate_action = xua_asp_allstate,
+ .cleanup = xua_asp_fsm_cleanup,
};
static struct osmo_fsm_inst *ipa_asp_fsm_start(struct osmo_ss7_asp *asp,
@@ -1040,6 +1048,7 @@ static void ipa_asp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cau
return;
osmo_ss7_route_destroy(rt);
+ osmo_timer_del(&iafp->pong_timer);
}
struct osmo_fsm ipa_asp_fsm = {