<p>Patch set 5:<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/+/13362">View Change</a></p><p>9 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c">File res/res_rtp_asterisk.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/asterisk/+/13362/5/res/res_rtp_asterisk.c@3034">Patch Set #5, Line 3034:</a> <code style="font-family:monospace,monospace">  static struct ast_sockaddr lo6 = { .len = 0 };</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This can be manipulated by multiple threads at once, doing the parse at module startup would be better.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3056">Patch Set #5, Line 3056:</a> <code style="font-family:monospace,monospace">           for (ia = ifa; ia && count < PJ_ICE_MAX_CAND; ia = ia->ifa_next) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think all of this new logic could use comments to describe precisely what is going on at each point for better understanding</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3057">Patch Set #5, Line 3057:</a> <code style="font-family:monospace,monospace">                  if (!ia->ifa_addr || (ia->ifa_flags & IFF_UP) == 0)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">With coding guidelines this should have {} brackets, same for other places.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3065">Patch Set #5, Line 3065:</a> <code style="font-family:monospace,monospace">                        if (ast_sockaddr_isnull(&tmp))</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Under what case would this be NULL?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3096">Patch Set #5, Line 3096:</a> <code style="font-family:monospace,monospace">                           if (ast_sockaddr_cmp(&candidate->local, &tmp) == 0) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">In Asterisk we just use !ast_sockaddr_cmp</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3108">Patch Set #5, Line 3108:</a> <code style="font-family:monospace,monospace"></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">If a match occurs this should break out and not continue iterating</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3113">Patch Set #5, Line 3113:</a> <code style="font-family:monospace,monospace">                     if (ast_sockaddr_isnull(&tmp) || count >= PJ_ICE_MAX_CAND)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">It shouldn't be possible for count to be > than PJ_ICE_MAX_CAND, if that happens then badness will occur</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3157">Patch Set #5, Line 3157:</a> <code style="font-family:monospace,monospace">                                ast_sockaddr_to_pj_sockaddr(addr, &base);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Does this present a behavior change at all with choosing the base based on addr?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13362/5/res/res_rtp_asterisk.c@3165">Patch Set #5, Line 3165:</a> <code style="font-family:monospace,monospace">                           if (!baseset && ast_sockaddr_is_ipv4(&candidate->address) && !ast_sockaddr_is_any(&candidate->address)) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Is it actually possible for a candidate to be any? I don't think that's valid for an ICE candidate</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13362">change 13362</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/+/13362"/><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: I109eaffc3e2b432f00bf958e3caa0f38cacb4edb </div>
<div style="display:none"> Gerrit-Change-Number: 13362 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 26 Mar 2020 13:18:51 +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>