<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1278/">https://reviewboard.asterisk.org/r/1278/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Terry Wilson.</div>


<p style="color: grey;"><i>Updated 2011-06-22 09:14:42.638423</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Addresses Simon&#39;s review.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">chan_sip incorrectly would send IPv6 link-local addresses with the scope-id in SIP messages. This is usually an interface name on the local machine and means nothing to the remote host and should not be sent.

The original patch submitted on the issue just stripped the &#39;%&#39; and everything after it from the host before doing any kind of stringification. I was uncomfortable with making a global change to how these functions operated and instead added new _remote versions of the stringification functions and had chan_sip use them when the results would end up in a SIP message. The non-remote versions of the functions are still used in things like debug messages and anywhere we might be using the information to make an outbound connection since the scope-id is necessary information in those cases.

Since registrations were the focus of the bug report, I also noticed that the URI, From, and To of the registration also included the scope-id and didn&#39;t use the stringification functions, so I added sip_sanitized_host() which would take a host and if it happened to be a link-local ipv6 address, would &quot;do the right thing&quot;.

I also added some netsock2 parsing tests.

I am not an IPv6 guru, so I would appreciate someone who is verifying this patch is a good idea.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I tested registering two asterisk boxes to each other using link-local ipv6 addresses. They failed before the patch and succeeded after.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-17711">ASTERISK-17711</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/1.8/include/asterisk/netsock2.h <span style="color: grey">(324299)</span></li>

 <li>/branches/1.8/main/netsock2.c <span style="color: grey">(324299)</span></li>

 <li>/branches/1.8/channels/chan_sip.c <span style="color: grey">(324299)</span></li>

 <li>/branches/1.8/tests/test_netsock2.c <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1278/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>