<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/23264">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ts_51_011: fix bitmask compositing in EF_xPLMNwAcT.enc_act()<br><br>This commit fixes two problems (found by semgrep):<br><br>  * "'foo' and 'bar' in list" is incorrect, because it's interpreted<br>    as "'foo' and ('bar' in list)".  Strings with a non-zero length<br>    evaluate to True, thus it's True if at least 'bar' is present.<br><br>  * Copy-pasted 'E-UTRAN NB-S1' checked two times.<br><br>The first condition is redundant, and the whole block can be<br>re-implemented using two independent 'if' statements.<br><br>Change-Id: Iceb66160cfb571db8879d3810c55d252c763d320<br>---<br>M pySim/ts_51_011.py<br>1 file changed, 4 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py</span><br><span>index 03d74ad..e4a26a3 100644</span><br><span>--- a/pySim/ts_51_011.py</span><br><span>+++ b/pySim/ts_51_011.py</span><br><span>@@ -527,12 +527,10 @@</span><br><span>         if 'cdma2000 1xRTT' in in_list:</span><br><span>             u16 |= 0x0010</span><br><span>         # E-UTRAN</span><br><span style="color: hsl(0, 100%, 40%);">-        if 'E-UTRAN WB-S1' and 'E-UTRAN NB-S1' in in_list:</span><br><span style="color: hsl(0, 100%, 40%);">-            u16 |= 0x7000   # WB-S1 and NB-S1</span><br><span style="color: hsl(0, 100%, 40%);">-        elif 'E-UTRAN NB-S1' in in_list:</span><br><span style="color: hsl(0, 100%, 40%);">-            u16 |= 0x6000   # only WB-S1</span><br><span style="color: hsl(0, 100%, 40%);">-        elif 'E-UTRAN NB-S1' in in_list:</span><br><span style="color: hsl(0, 100%, 40%);">-            u16 |= 0x5000   # only NB-S1</span><br><span style="color: hsl(120, 100%, 40%);">+        if 'E-UTRAN WB-S1' in in_list:</span><br><span style="color: hsl(120, 100%, 40%);">+            u16 |= 0x6000</span><br><span style="color: hsl(120, 100%, 40%);">+        if 'E-UTRAN NB-S1' in in_list:</span><br><span style="color: hsl(120, 100%, 40%);">+            u16 |= 0x5000</span><br><span>         # GSM mess</span><br><span>         if 'GSM' in in_list and 'EC-GSM-IoT' in in_list:</span><br><span>             u16 |= 0x008C</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/23264">change 23264</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/pysim/+/23264"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iceb66160cfb571db8879d3810c55d252c763d320 </div>
<div style="display:none"> Gerrit-Change-Number: 23264 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@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-MessageType: merged </div>