<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/24181">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Constrain connection ID allocation to 24 bits<br><br>We currently use the local connection ID on the SCU SAP also as local<br>reference on the wire-line SCCP messages.  However, the latter only has<br>a 24 bit range, so we should make sure to wrap accordingly on<br>allocation.<br><br>Change-Id: I414d29271da48ac0b05a688ce9e949a66e4d0d92<br>Closes: OS#3921<br>Related: OS#3871<br>---<br>M src/sccp_scoc.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c</span><br><span>index 1ce08f8..244e6d3 100644</span><br><span>--- a/src/sccp_scoc.c</span><br><span>+++ b/src/sccp_scoc.c</span><br><span>@@ -499,7 +499,10 @@</span><br><span>      uint32_t conn_id;</span><br><span> </span><br><span>        do {</span><br><span style="color: hsl(0, 100%, 40%);">-            conn_id = user->inst->next_id++;</span><br><span style="color: hsl(120, 100%, 40%);">+                /* modulo 2^24 as we currently use the connection ID also as local</span><br><span style="color: hsl(120, 100%, 40%);">+             * reference, and that is limited to 24 bits */</span><br><span style="color: hsl(120, 100%, 40%);">+               user->inst->next_id = (user->inst->next_id + 1) %  (1 << 24);</span><br><span style="color: hsl(120, 100%, 40%);">+               conn_id = user->inst->next_id;</span><br><span>         } while (conn_find_by_id(user->inst, conn_id));</span><br><span> </span><br><span>       return conn_create_id(user, conn_id);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/24181">change 24181</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/c/libosmo-sccp/+/24181"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I414d29271da48ac0b05a688ce9e949a66e4d0d92 </div>
<div style="display:none"> Gerrit-Change-Number: 24181 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>