[asterisk-bugs] [Asterisk 0017711]: [patch] sip/reqresp_parser.c:sip_uri_cmp_test failure

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jul 26 10:06:46 CDT 2010


The following issue has been RESOLVED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17711 
====================================================================== 
Reported By:                pabelanger
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   17711
Category:                   Channels/chan_sip/IPv6
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Asterisk Version:           1.8.0-beta1 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-07-25 20:53 CDT
Last Modified:              2010-07-26 10:06 CDT
====================================================================== 
Summary:                    [patch] sip/reqresp_parser.c:sip_uri_cmp_test
failure
Description: 
Managed to track down an issue with ast_sockaddr_parse(), but all tests
seemed to pass.

sip_uri_cmp_test does not check to see if ast_sockaddr_parse() fails, I've
uploaded a patch, now checking for the error.  As a result, the test will
now fail.
====================================================================== 

---------------------------------------------------------------------- 
 (0125028) mmichelson (administrator) - 2010-07-26 10:06
 https://issues.asterisk.org/view.php?id=17711#c125028 
---------------------------------------------------------------------- 
The reported issue is actually not an issue.

One stage of the URI comparison is to place the domain names through the
sip_uri_domain_cmp() function. The first thing this function does is to
call ast_sockaddr_parse() on the content. ast_sockaddr_parse() is intended
to take an IP address and optional port specification as a string and place
the content into an ast_sockaddr structure.

ast_sockaddr_parse() will fail to parse a hostname, though. So in a case
where a URI like "sip:bob at example.com" is being compared to something else,
ast_sockaddr_parse() will fail to parse "example.com" from the URI since it
is not an IP address. This is not an error in the URI comparison though
since "example.com" is a valid hostname. The problem happens if
ast_sockaddr_parse() fails for one host and does not for another host. This
means that we are trying to compare a hostname and an IP address, which are
always considered to not be equal by SIP URI comparison rules. Using the
return values for ast_sockaddr_parse(), we can then determine whether to do
a binary comparison or string comparison to determine if the URIs are the
same. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-26 10:06 mmichelson     Note Added: 0125028                          
2010-07-26 10:06 mmichelson     Status                   new => resolved     
2010-07-26 10:06 mmichelson     Resolution               open => no change
required
2010-07-26 10:06 mmichelson     Assigned To               => mmichelson      
======================================================================




More information about the asterisk-bugs mailing list