<p style="white-space: pre-wrap; word-wrap: break-word;">I know nothing about this protocol, but based on Wireshark's dissector, I see nothing different between the 4 ports being assigned in this block:</p><p style="white-space: pre-wrap; word-wrap: break-word;">https://github.com/wireshark/wireshark/blob/master/plugins/epan/unistim/packet-unistim.c#L2272-L2284</p><p style="white-space: pre-wrap; word-wrap: break-word;">So I feel like we should be changing all of them or none of them, but I will defer to someone with a better understanding of the protocol.</p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12747">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/12747/1/channels/chan_unistim.c">File channels/chan_unistim.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/12747/1/channels/chan_unistim.c@2769">Patch Set #1, Line 2769:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">         buffsend[24] = (htons(us.sin_port) & 0xff00) >> 8;<br>                  buffsend[25] = (htons(us.sin_port) & 0x00ff);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">So I assume the previous code was using the mask & shift to try and emulate htons()? I guess?</p><p style="white-space: pre-wrap; word-wrap: break-word;">It would be much cleaner to use put_unaligned_uint16() here:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> put_unaligned_uint16(&buffsend[24], htons(us.sin_port));</pre><p style="white-space: pre-wrap; word-wrap: break-word;">And why wouldn't we perform the same operation on the 3 other ports here?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12747">change 12747</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/c/asterisk/+/12747"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I9a9ca7f26e31a67bbbceff12923baa10dfb8a3be </div>
<div style="display:none"> Gerrit-Change-Number: 12747 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Igor Goncharovsky <igor.goncharovsky@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 16 Aug 2019 12:27:45 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>