<p>George Joseph <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>(3 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@4688">Patch Set #4, Line 4688:</a> <code style="font-family:monospace,monospace">first_word & RTCP_VERSION_MASK) == RTCP_VERSION</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">This is exactly what the RFC check tests in addition to<br>accumulating the length fields.  No other bits can be validated<br>after the first RTCP packet header in a combination packet.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">What do you mean "can be validated"?  Can't we even check that the packet type is valid in the next packet?</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Really?  Doing this does disable the length check for unknown<br>packet types.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Yeah but we keep processing..  Why not just short circuit here?</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Because it cannot be combined with the previous switch statement. <br>Or do you think I should duplicate the length check code and<br>message?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Nah, I don't think you have to duplicate it.  It just _seems_ that both switch statements have a lot of fallthroughs that do nothing.  Both could probably be replaced with a few "if" statements.</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 15:32:45 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>