aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/xua_as_fsm.c8
-rw-r--r--src/xua_asp_fsm.c9
2 files changed, 17 insertions, 0 deletions
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 59a71ba..5757d63 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -315,6 +315,13 @@ static void xua_as_fsm_pending(struct osmo_fsm_inst *fi, uint32_t event, void *d
}
}
+static void xua_as_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
+{
+ struct xua_as_fsm_priv *xafp = (struct xua_as_fsm_priv *) fi->priv;
+
+ osmo_timer_del(&xafp->recovery.t_r);
+}
+
static const struct osmo_fsm_state xua_as_fsm_states[] = {
[XUA_AS_S_DOWN] = {
.in_event_mask = S(XUA_ASPAS_ASP_INACTIVE_IND) |
@@ -368,6 +375,7 @@ struct osmo_fsm xua_as_fsm = {
.num_states = ARRAY_SIZE(xua_as_fsm_states),
.log_subsys = DLSS7,
.event_names = xua_as_event_names,
+ .cleanup = xua_as_fsm_cleanup,
};
/*! \brief Start an AS FSM for a given Application Server
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 = {