<p>Torrey Searle has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11575">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">main/udptl.c: correctly handle udptl sequence wrap around<br><br>incorrect handling of UDPTL squence number wrap arounds causes<br>loss of packets every time the wrap arround occurs<br><br>ASTERISK-28483 #close<br><br>Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234<br>---<br>M main/udptl.c<br>1 file changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/75/11575/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/udptl.c b/main/udptl.c</span><br><span>index 59fccf4..2572f5c 100644</span><br><span>--- a/main/udptl.c</span><br><span>+++ b/main/udptl.c</span><br><span>@@ -406,6 +406,15 @@</span><br><span>        seq_no = (buf[0] << 8) | buf[1];</span><br><span>       ptr += 2;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* compensate for sequence number wrap arounds */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (seq_no < 0x000F && s->rx_seq_no > 0xFFF0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              /* received seq_no has wrapped adjust it */</span><br><span style="color: hsl(120, 100%, 40%);">+           seq_no += 0x10000;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              /* otherwise make sure expected rx_seq_no is properly wrapped */</span><br><span style="color: hsl(120, 100%, 40%);">+              s->rx_seq_no &= 0xFFFF;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* Break out the primary packet */</span><br><span>   if ((stat1 = decode_open_type(buf, len, &ptr, &ifp, &ifp_len)) != 0)</span><br><span>             return -1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11575">change 11575</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/+/11575"/><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: I33caeb2bf13c574a1ebb81714b58907091d64234 </div>
<div style="display:none"> Gerrit-Change-Number: 11575 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>