aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-07-27 16:05:01 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-07-28 12:18:23 +0200
commit52b5298eab4f6359c22eab9d6637c6d1f3b19ffa (patch)
tree96f40eb26413cc33ffe4282d2a9bcc98704e3855 /src
parent459113d810b24b36c8d3af74fd77b61f71aa27d7 (diff)
timeslot FSM: fix infinite recursion on failure to send PDCH ACT
If PDCH ACT sending fails and we go back to UNUSED, the UNUSED onenter goes right back to PDCH ACT and we loop. Avoid by going straight to broken state. Actually, if we can't send messages, the timeslot is obviously broken, so also enter the broken state if PDCH deactivation fails to be sent out. Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/timeslot_fsm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 245ce76f7..4514f3406 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -345,9 +345,11 @@ static void ts_fsm_wait_pdch_act_onenter(struct osmo_fsm_inst *fi, uint32_t prev
rc = rsl_tx_dyn_ts_pdch_act_deact(ts, true);
- /* On error, we couldn't send the activation message and remain unused. */
+ /* On error, we couldn't send the activation message. If we can't send messages, we're broken.
+ * (Also avoiding a recursion loop: enter UNUSED, try to PDCH act, fail, enter UNUSED, try to
+ * PDCH act,...). */
if (rc)
- ts_fsm_error(fi, TS_ST_UNUSED, "Unable to send PDCH activation");
+ ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH activation");
}
static void ts_fsm_wait_pdch_act(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -464,9 +466,10 @@ static void ts_fsm_wait_pdch_deact_onenter(struct osmo_fsm_inst *fi, uint32_t pr
rc = rsl_tx_dyn_ts_pdch_act_deact(ts, false);
- /* On error, we couldn't send the deactivation message and remain in PDCH. */
+ /* On error, we couldn't send the deactivation message. If we can't send messages, we're broken.
+ */
if (rc)
- ts_fsm_error(fi, TS_ST_PDCH, "Unable to send PDCH deactivation");
+ ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH deactivation");
}
static void ts_fsm_wait_pdch_deact(struct osmo_fsm_inst *fi, uint32_t event, void *data)