<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/20492">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pcu_sock: fix {local,remote}_port byte ordering in pcu_tx_info_ind()<br><br>The PCUIF is a 'brilliant' protocol: some fields are expected to<br>be in the network byte order, some in the host order.  The NSVC<br>remote address and local/remote ports is a good example:<br><br>  - byte order of the address must be the network order, and<br>  - byte order of the ports must be the host order.<br><br>Change-Id: I383cab0b58b62734090023298da8c5a341c670d5<br>Fixes: I310699fabbfec4255f0474f31717f215c1201eca<br>Related: SYS#4915<br>---<br>M src/common/pcu_sock.c<br>1 file changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/20492/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c</span><br><span>index 68cd039..7bb1f7b 100644</span><br><span>--- a/src/common/pcu_sock.c</span><br><span>+++ b/src/common/pcu_sock.c</span><br><span>@@ -330,8 +330,10 @@</span><br><span>      for (i = 0; i < 2; i++) {</span><br><span>                 nsvc = &bts->gprs.nsvc[i];</span><br><span>            info_ind->nsvci[i] = nsvc->nsvci;</span><br><span style="color: hsl(0, 100%, 40%);">-         info_ind->local_port[i] = nsvc->local.u.sin.sin_port;</span><br><span style="color: hsl(0, 100%, 40%);">-             info_ind->remote_port[i] = nsvc->remote.u.sin.sin_port;</span><br><span style="color: hsl(120, 100%, 40%);">+         /* PCUIF beauty: the NSVC addresses are sent in the network byte order,</span><br><span style="color: hsl(120, 100%, 40%);">+                * while the port numbers need to be send in the host order.  Sigh. */</span><br><span style="color: hsl(120, 100%, 40%);">+                info_ind->local_port[i] = ntohs(nsvc->local.u.sin.sin_port);</span><br><span style="color: hsl(120, 100%, 40%);">+            info_ind->remote_port[i] = ntohs(nsvc->remote.u.sin.sin_port);</span><br><span>                 switch (nsvc->remote.u.sas.ss_family) {</span><br><span>           case AF_INET:</span><br><span>                        info_ind->address_type[i] = PCU_IF_ADDR_TYPE_IPV4;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/20492">change 20492</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/+/20492"/><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: I383cab0b58b62734090023298da8c5a341c670d5 </div>
<div style="display:none"> Gerrit-Change-Number: 20492 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>