[Home]

Summary:ASTERISK-16382: [patch] redirecting to IPv6 URIs
Reporter:Olle Johansson (oej)Labels:
Date Opened:2010-07-16 07:26:40Date Closed:2010-07-27 13:55:05
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/IPv6
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 17661.diff
Description:static int sip_sipredirect(struct sip_pvt *p, const char *dest){        char *cdest;        char *extension, *host, *port;        char tmp[80];

       cdest = ast_strdupa(dest);

       extension = strsep(&cdest, "@");
       host = strsep(&cdest, ":");
       port = strsep(&cdest, ":");


This code will not be able to parse a sip:lattjolajban@[fdd8:899a:a995:32dc:225:4bff:fea8:1d88]:5032 URI.
Comments:By: Mark Michelson (mmichelson) 2010-07-16 12:45:28

I've uploaded 17661.diff to the issue.

In this case, I noticed that there was no special handling for the port and so it was pointless to be parsing it out at all. I also took the opportunity to rename "tmp" and "localtmp" to more descriptive names.

Let me know if you see any potential problems with the change.

By: Digium Subversion (svnbot) 2010-07-27 13:54:06

Repository: asterisk
Revision: 279887

U   branches/1.8/channels/chan_sip.c

------------------------------------------------------------------------
r279887 | mmichelson | 2010-07-27 13:54:06 -0500 (Tue, 27 Jul 2010) | 16 lines

Fix parsing error in sip_sipredirect().

The code was written in a way that did a bad job of
parsing the port out of a URI. Specifically, it would
do badly when dealing with an IPv6 address. In this
particular scenario, there was no value from parsing
the port out, so I just removed that logic. And while
I was messing around in the function, I changed some
variable names to be more descriptive.

(closes issue ASTERISK-16382)
Reported by: oej
Patches:
     17661.diff uploaded by mmichelson (license 60)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=279887

By: Digium Subversion (svnbot) 2010-07-27 13:55:05

Repository: asterisk
Revision: 279888

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r279888 | mmichelson | 2010-07-27 13:55:04 -0500 (Tue, 27 Jul 2010) | 22 lines

Merged revisions 279887 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r279887 | mmichelson | 2010-07-27 13:54:07 -0500 (Tue, 27 Jul 2010) | 16 lines
 
 Fix parsing error in sip_sipredirect().
 
 The code was written in a way that did a bad job of
 parsing the port out of a URI. Specifically, it would
 do badly when dealing with an IPv6 address. In this
 particular scenario, there was no value from parsing
 the port out, so I just removed that logic. And while
 I was messing around in the function, I changed some
 variable names to be more descriptive.
 
 (closes issue ASTERISK-16382)
 Reported by: oej
 Patches:
       17661.diff uploaded by mmichelson (license 60)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=279888