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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">auc3g: officially wrap IND around IND_bitlen space<br><br>To determine distinct IND pools for each connected VLR, we need to pick ever<br>increasing values for any new peer showing up. Each subscriber's individual<br>IND_bitlen is then required to modulo the least significant N of bits that fit<br>in its IND_bitlen to effectively round-robin in the available IND pool space.<br>So far we did that but issued a warning message. This is actually exactly what<br>we want and it doesn't need to be treated like it weren't so.<br><br>Change-Id: I716d8a8a249235c8093d7a6a78b3535d893d867e<br>---<br>M src/db_auc.c<br>1 file changed, 9 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/db_auc.c b/src/db_auc.c</span><br><span>index ecb9f58..975eb2d 100644</span><br><span>--- a/src/db_auc.c</span><br><span>+++ b/src/db_auc.c</span><br><span>@@ -200,15 +200,16 @@</span><br><span>        if (rc)</span><br><span>              return rc;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        /* modulo by the IND bitlen value range. For example, ind_bitlen == 5 would modulo 32:</span><br><span style="color: hsl(120, 100%, 40%);">+         * 1 << 5 == 0b0100000 == 32</span><br><span style="color: hsl(120, 100%, 40%);">+     * - 1 == 0b0011111 == bitmask of 5 lowest bits</span><br><span style="color: hsl(120, 100%, 40%);">+        * x &= 0b0011111 == modulo 32</span><br><span style="color: hsl(120, 100%, 40%);">+     * Why do this? osmo-hlr cannot possibly choose individual VLR INDs always matching all subscribers' IND_bitlen,</span><br><span style="color: hsl(120, 100%, 40%);">+   * which might vary wildly. Instead, let hlr.c pass in an arbitrarily high number here, and the modulo does a</span><br><span style="color: hsl(120, 100%, 40%);">+  * round-robin if the IND pools that this subscriber has available. */</span><br><span style="color: hsl(120, 100%, 40%);">+        auc_3g_ind &= (1U << aud3g.u.umts.ind_bitlen) - 1;</span><br><span>         aud3g.u.umts.ind = auc_3g_ind;</span><br><span style="color: hsl(0, 100%, 40%);">-  if (aud3g.type == OSMO_AUTH_TYPE_UMTS</span><br><span style="color: hsl(0, 100%, 40%);">-       && aud3g.u.umts.ind >= (1U << aud3g.u.umts.ind_bitlen)) {</span><br><span style="color: hsl(0, 100%, 40%);">-          LOGAUC(imsi, LOGL_NOTICE, "3G auth: SQN's IND bitlen %u is"</span><br><span style="color: hsl(0, 100%, 40%);">-                      " too small to hold an index of %u. Truncating. This"</span><br><span style="color: hsl(0, 100%, 40%);">-                 " may cause numerous additional AUTS resyncing.\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                   aud3g.u.umts.ind_bitlen, aud3g.u.umts.ind);</span><br><span style="color: hsl(0, 100%, 40%);">-              aud3g.u.umts.ind &= (1U << aud3g.u.umts.ind_bitlen) - 1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* the first bit (bit0) cannot be used as AMF anymore, but has been</span><br><span>   * re-appropriated as the separation bit.  See 3GPP TS 33.102 Annex H</span><br><span>         * together with 3GPP TS 33.401 / 33.402 / 33.501 */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16763">change 16763</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/osmo-hlr/+/16763"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I716d8a8a249235c8093d7a6a78b3535d893d867e </div>
<div style="display:none"> Gerrit-Change-Number: 16763 </div>
<div style="display:none"> Gerrit-PatchSet: 13 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </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: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>