<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10191">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">timeslot FSM: fix infinite recursion on failure to send PDCH ACT<br><br>If PDCH ACT sending fails and we go back to UNUSED, the UNUSED onenter goes<br>right back to PDCH ACT and we loop. Avoid by going straight to broken state.<br><br>Actually, if we can't send messages, the timeslot is obviously broken, so also<br>enter the broken state if PDCH deactivation fails to be sent out.<br><br>Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31<br>---<br>M src/osmo-bsc/timeslot_fsm.c<br>1 file changed, 7 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/10191/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c</span><br><span>index 245ce76..4514f34 100644</span><br><span>--- a/src/osmo-bsc/timeslot_fsm.c</span><br><span>+++ b/src/osmo-bsc/timeslot_fsm.c</span><br><span>@@ -345,9 +345,11 @@</span><br><span> </span><br><span>  rc = rsl_tx_dyn_ts_pdch_act_deact(ts, true);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        /* On error, we couldn't send the activation message and remain unused. */</span><br><span style="color: hsl(120, 100%, 40%);">+        /* On error, we couldn't send the activation message. If we can't send messages, we're broken.</span><br><span style="color: hsl(120, 100%, 40%);">+     * (Also avoiding a recursion loop: enter UNUSED, try to PDCH act, fail, enter UNUSED, try to</span><br><span style="color: hsl(120, 100%, 40%);">+  * PDCH act,...). */</span><br><span>         if (rc)</span><br><span style="color: hsl(0, 100%, 40%);">-         ts_fsm_error(fi, TS_ST_UNUSED, "Unable to send PDCH activation");</span><br><span style="color: hsl(120, 100%, 40%);">+           ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH activation");</span><br><span> }</span><br><span> </span><br><span> static void ts_fsm_wait_pdch_act(struct osmo_fsm_inst *fi, uint32_t event, void *data)</span><br><span>@@ -464,9 +466,10 @@</span><br><span> </span><br><span>    rc = rsl_tx_dyn_ts_pdch_act_deact(ts, false);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-       /* On error, we couldn't send the deactivation message and remain in PDCH. */</span><br><span style="color: hsl(120, 100%, 40%);">+     /* On error, we couldn't send the deactivation message. If we can't send messages, we're broken.</span><br><span style="color: hsl(120, 100%, 40%);">+   */</span><br><span>  if (rc)</span><br><span style="color: hsl(0, 100%, 40%);">-         ts_fsm_error(fi, TS_ST_PDCH, "Unable to send PDCH deactivation");</span><br><span style="color: hsl(120, 100%, 40%);">+           ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH deactivation");</span><br><span> }</span><br><span> </span><br><span> static void ts_fsm_wait_pdch_deact(struct osmo_fsm_inst *fi, uint32_t event, void *data)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10191">change 10191</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10191"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31 </div>
<div style="display:none"> Gerrit-Change-Number: 10191 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>