[asterisk-bugs] [Asterisk 0017662]: IPv6: sip_uri_cmp

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jul 16 11:06:45 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17662 
====================================================================== 
Reported By:                oej
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17662
Category:                   Channels/chan_sip/IPv6
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           SVN 
JIRA:                       SWP-1863 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 277027 
Request Review:              
====================================================================== 
Date Submitted:             2010-07-16 07:41 CDT
Last Modified:              2010-07-16 11:06 CDT
====================================================================== 
Summary:                    IPv6: sip_uri_cmp
Description: 
The sip_uri_cmp function separates on two :'s 


/* Strip off "sip:" from the URI. We know this is present
         * because it was checked back in parse_request()
         */
        strsep(&uri1, ":");
        strsep(&uri2, ":");



and then compares hosts with strcmp...

For IP addresses, you need to do a binary comparision. Since there are
many ways to write the same IPv6 address, and there are ways to write IPv4
embedded in IPv6, you need to compare IP addresses here.

The function also strips of header parameters, so
sip:oej at edvina.net;transport=udp and sip:oej at edvina.net;transport=tcp
becomes the same URI, which they are not.

====================================================================== 

---------------------------------------------------------------------- 
 (0124611) mmichelson (administrator) - 2010-07-16 11:06
 https://issues.asterisk.org/view.php?id=17662#c124611 
---------------------------------------------------------------------- 
Definitely a good point regarding the comparison of the IP addresses. That
needs to be fixed because the current behavior is clearly incorrect.

I think you are mistaken with regards to the parameters though. You can
see that we call sip_uri_params_cmp() with the parameters later in the
function. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-16 11:06 mmichelson     Note Added: 0124611                          
======================================================================




More information about the asterisk-bugs mailing list