<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/23829">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts-trx: discard TRXD PDUs with unexpected version<br><br>Change-Id: Icdc3d12a7686428046113f9fa8f21a99569e651a<br>Related: SYS#4895, OS#4941, OS#4006<br>---<br>M src/osmo-bts-trx/trx_if.c<br>1 file changed, 11 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/23829/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c</span><br><span>index e51b2e0..a528599 100644</span><br><span>--- a/src/osmo-bts-trx/trx_if.c</span><br><span>+++ b/src/osmo-bts-trx/trx_if.c</span><br><span>@@ -945,8 +945,18 @@</span><br><span>   /* Pre-clean (initialize) the flags */</span><br><span>       bi.flags = 0x00;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    /* Parse header depending on the PDU version */</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Parse PDU version first */</span><br><span>        pdu_ver = buf[0] >> 4;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Make sure that PDU version matches our expectations */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (pdu_ver != l1h->config.trxd_pdu_ver_use) {</span><br><span style="color: hsl(120, 100%, 40%);">+             LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                   "Rx TRXD PDU with unexpected version %u (expected %u)\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                   pdu_ver, l1h->config.trxd_pdu_ver_use);</span><br><span style="color: hsl(120, 100%, 40%);">+            return -EIO;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Parse header depending on the PDU version */</span><br><span>      switch (pdu_ver) {</span><br><span>   case 0:</span><br><span>              /* Legacy protocol has no version indicator */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/23829">change 23829</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-bts/+/23829"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icdc3d12a7686428046113f9fa8f21a99569e651a </div>
<div style="display:none"> Gerrit-Change-Number: 23829 </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-MessageType: newchange </div>