<p>Richard Mudgett <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/6443">View Change</a></p><p>Patch set 4:</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'll see about improving how the code is expressed.  There is only so much that can be done if you haven't seen the RFC.</p><p>(5 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/6443/4/res/res_rtp_asterisk.c">File res/res_rtp_asterisk.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6443/4/res/res_rtp_asterisk.c@4644">Patch Set #4, Line 4644:</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;">#define RTCP_VALID_MASK (RTCP_VERSION_MASK | (0xfe << 16))<br>#define RTCP_VALID_VALUE (RTCP_VERSION | (RTCP_PT_SR << 16))<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I take it that your intent here by using 0xfe is to include both SR(200) an</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is already an improvement over how the RFC expressed it.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6443/4/res/res_rtp_asterisk.c@4688">Patch Set #4, Line 4688:</a> <code style="font-family:monospace,monospace">first_word & RTCP_VERSION_MASK) == RTCP_VERSION</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Is just checking 2 bits enough to determine that it's a valid rtcp packet? </blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is exactly what the RFC check tests in addition to accumulating the length fields.  No other bits can be validated after the first RTCP packet header in a combination packet.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6443/4/res/res_rtp_asterisk.c@4720">Patch Set #4, Line 4720:</a> <code style="font-family:monospace,monospace">ssrc_valid</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This implies it's a "valid" ssrc but an ssrc isn't really valid or invalid.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">It implies that we actually have an SSRC verses not having one.  Thus the ssrc variable value we have is valid.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6443/4/res/res_rtp_asterisk.c@4755">Patch Set #4, Line 4755:</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;">                      /* We don't know what min_length should be so disable the check */<br>                        min_length = length;<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Isn't this also going to catch an unknown packet type?  In that case, shoul</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Really?  Doing this does disable the length check for unknown packet types.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6443/4/res/res_rtp_asterisk.c@4766">Patch Set #4, Line 4766:</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;">             /* Get the RTCP record SSRC if defined for the record */<br>              ssrc_valid = 1;<br>               switch (pt) {<br>         case RTCP_PT_SR:<br>              case RTCP_PT_RR:<br>                      rtcp_report = ast_rtp_rtcp_report_alloc(rc);<br>                  if (!rtcp_report) {<br>                           return &ast_null_frame;<br>                   }<br>                     rtcp_report->reception_report_count = rc;<br><br>                        ssrc = ntohl(rtcpheader[i + 1]);<br>                      rtcp_report->ssrc = ssrc;<br>                  break;<br>                case RTCP_PT_FUR:<br>             case RTCP_PT_PSFB:<br>                    ssrc = ntohl(rtcpheader[i + 1]);<br>                      break;<br>                case RTCP_PT_SDES:<br>            case RTCP_PT_BYE:<br>             default:<br>                      ssrc = 0;<br>                     ssrc_valid = 0;<br>                       break;<br>                }<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Why not combine this switch with the earlier one?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Because it cannot be combined with the previous switch statement.  Or do you think I should duplicate the length check code and message?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/6443">change 6443</a>. To unsubscribe, 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/6443"/><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-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I67d89e3c27db83efa0e6b52734f73c88ac2939e2 </div>
<div style="display:none"> Gerrit-Change-Number: 6443 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 13 Sep 2017 14:50:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>