<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10333">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">GSCON: avoid sending clear when not connected<br><br>The function gscon_lchan_releasing() may be called randomly by any other<br>entity. It then sets the FSM state to ST_CLEARING and sends a BSSMAP<br>CLEAR REQUEST by using gscon_bssmap_clear()<br><br>Normally gscon_bssmap_clear() protects against sending connection<br>oriented data when no connection is present. This is done by checking<br>if the FSM state is ST_INIT or ST_WAIT_CC. If yes, then nothing is sent.<br><br>Now gscon_lchan_releasing() defeats this check by first setting the FSM<br>to ST_CLEARING and then trying to send. This causes<br>osmo_bsc_sigtran_send() to be called and the assertion<br>OSMO_ASSERT(conn->sccp.msc); blows because we never had a connection so<br>sccp.msc is unpopulated.<br><br>We have the possibility to get around the problem by first checking if<br>we are in ST_CLEARING. If yes, we do nothing. If not we still must be in<br>ST_INIT when we never had a connection before. So we may call<br>on_bssmap_clear() without any problem and then set the state to<br>ST_CLEARING.<br><br>OS#3446<br><br>Change-Id: I4eaa983702224e5995a388ea9890ee04212eb569<br>---<br>M src/osmo-bsc/bsc_subscr_conn_fsm.c<br>1 file changed, 3 insertions(+), 2 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/33/10333/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c</span><br><span>index 81fe9f6..bc7539b 100644</span><br><span>--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c</span><br><span>+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c</span><br><span>@@ -627,9 +627,10 @@</span><br><span>           conn->lchan = NULL;</span><br><span>       }</span><br><span>    if (!conn->lchan) {</span><br><span style="color: hsl(0, 100%, 40%);">-          if (conn->fi->state != ST_CLEARING)</span><br><span style="color: hsl(120, 100%, 40%);">+             if (conn->fi->state != ST_CLEARING) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   gscon_bssmap_clear(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE);</span><br><span>                   osmo_fsm_inst_state_chg(conn->fi, ST_CLEARING, 60, 999);</span><br><span style="color: hsl(0, 100%, 40%);">-             gscon_bssmap_clear(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE);</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span>    }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10333">change 10333</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/10333"/><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: I4eaa983702224e5995a388ea9890ee04212eb569 </div>
<div style="display:none"> Gerrit-Change-Number: 10333 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>