<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/14845">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">trxd_fill_common(): fix TRXD header version coding<br><br>The expression "version && 0x07" is wrong because it performs a<br>Boolean operation on a constant other than 0 or 1. We actually<br>need a binary AND here. Also, version field is 4 bit long, so<br>the mask 0x07 == 0b111 should actually be 0b1111.<br><br>Change-Id: I290931559ce01cf6e43470b18855c46808d6c2a5<br>Fixes: CID#202038 Integer handling issues<br>---<br>M Transceiver52M/proto_trxd.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/45/14845/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Transceiver52M/proto_trxd.c b/Transceiver52M/proto_trxd.c</span><br><span>index fff23da..fbef77a 100644</span><br><span>--- a/Transceiver52M/proto_trxd.c</span><br><span>+++ b/Transceiver52M/proto_trxd.c</span><br><span>@@ -27,7 +27,7 @@</span><br><span> </span><br><span> static void trxd_fill_common(struct trxd_hdr_common *common, const struct trx_ul_burst_ind *bi, uint8_t version)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-    common->version = version && 0x07;</span><br><span style="color: hsl(120, 100%, 40%);">+ common->version = version & 0b1111;</span><br><span>   common->reserved = 0;</span><br><span>     common->tn = bi->tn;</span><br><span>   osmo_store32be(bi->fn, &common->fn);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/14845">change 14845</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-trx/+/14845"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I290931559ce01cf6e43470b18855c46808d6c2a5 </div>
<div style="display:none"> Gerrit-Change-Number: 14845 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>