<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11098">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix LCLS during Assignment: actually use new TCH lchan<br><br>In assignment_success(), don't trigger lcls_apply_config() before the<br>conn->lchan points at the actual new voice lchan. The entire LCLS code relies<br>on conn->lchan.<br><br>The assignment FSM wants to point conn->lchan to the new lchan only after it is<br>sure that sending the Assignment Complete to the MSC was successful. However, a<br>failure is a) very unlikely and b) if sending to the MSC fails we might as well<br>tear the whole conn down anyway. Now, if sending to the MSC fails, release the<br>lchan and the conn should clean itself up.<br><br>Related: OS#1602<br>Change-Id: I8dd561d744d8081b5ac5ffa7635f17ac19bcda45<br>---<br>M src/osmo-bsc/assignment_fsm.c<br>1 file changed, 13 insertions(+), 9 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/98/11098/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c</span><br><span>index 5304d6c..a7564e0 100644</span><br><span>--- a/src/osmo-bsc/assignment_fsm.c</span><br><span>+++ b/src/osmo-bsc/assignment_fsm.c</span><br><span>@@ -200,19 +200,23 @@</span><br><span> </span><br><span> static void assignment_success(struct gsm_subscriber_connection *conn)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        /* apply LCLS configuration (if any) */</span><br><span style="color: hsl(0, 100%, 40%);">- lcls_apply_config(conn);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        send_assignment_complete(conn, conn->assignment.new_lchan);</span><br><span style="color: hsl(0, 100%, 40%);">-  /* If something went wrong during send_assignment_complete(), the fi will be gone from</span><br><span style="color: hsl(0, 100%, 40%);">-   * error handling in there. Almost a success, but then again the whole thing failed. */</span><br><span style="color: hsl(0, 100%, 40%);">- if (!conn->assignment.fi)</span><br><span style="color: hsl(0, 100%, 40%);">-            return;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>      /* Take on the new lchan */</span><br><span>  gscon_change_primary_lchan(conn, conn->assignment.new_lchan);</span><br><span>     conn->assignment.new_lchan = NULL;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     /* apply LCLS configuration (if any) */</span><br><span style="color: hsl(120, 100%, 40%);">+       lcls_apply_config(conn);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    send_assignment_complete(conn, conn->lchan);</span><br><span style="color: hsl(120, 100%, 40%);">+       /* If something went wrong during send_assignment_complete(), the fi will be gone from</span><br><span style="color: hsl(120, 100%, 40%);">+         * error handling in there. Almost a success, but then again the whole thing failed. */</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!conn->assignment.fi) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* The lchan was ready, and we failed to tell the MSC about it. By releasing this lchan,</span><br><span style="color: hsl(120, 100%, 40%);">+               * the conn will notice that its primary lchan is gone and should clean itself up. */</span><br><span style="color: hsl(120, 100%, 40%);">+         lchan_release(conn->lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);</span><br><span style="color: hsl(120, 100%, 40%);">+           return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* Rembered this only for error handling: should assignment fail, assignment_reset() will release</span><br><span>     * the MGW endpoint right away. If successful, the conn continues to use the endpoint. */</span><br><span>    conn->assignment.created_ci_for_msc = NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11098">change 11098</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/11098"/><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: I8dd561d744d8081b5ac5ffa7635f17ac19bcda45 </div>
<div style="display:none"> Gerrit-Change-Number: 11098 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>