aboutsummaryrefslogtreecommitdiffstats
path: root/src/fsm.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-07-10 15:13:51 +0200
committerHarald Welte <laforge@gnumonks.org>2016-07-10 15:13:51 +0200
commit02a66728856d6a111ef61eca2cc052df052579a9 (patch)
tree5743a8cab056bddfbbec86bed13045d9532962bf /src/fsm.c
parentf3239113db910962a4ccac2f93d689a86450264f (diff)
fsm: delete the timer when changing state
In osmo_fsm_inst_state_chg(), we need to stop any not-yet-expired timer of the old state before transitioning into the new state. Change-Id: I2558f9a7027a877ea8263785ed3c8d70d2513996
Diffstat (limited to 'src/fsm.c')
-rw-r--r--src/fsm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fsm.c b/src/fsm.c
index 049663d7..67db1825 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -318,6 +318,9 @@ int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
return -EPERM;
}
+ /* delete the old timer */
+ osmo_timer_del(&fi->timer);
+
if (st->onleave)
st->onleave(fi, new_state);