[Home]

Summary:ASTERISK-16341: [patch] IPv6 - Potential issue in via header parsing
Reporter:Olle Johansson (oej)Labels:
Date Opened:2010-07-09 07:47:41Date Closed:2010-07-09 14:47:54
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) diff
Description:14223                 c = ast_skip_blanks(c+1);
14224                 if (strcasecmp(via, "SIP/2.0/UDP") && strcasecmp(via, "SIP/2.0/TCP") && strcasecmp(via, "SIP/2.0/TLS")) {
14225                         ast_log(LOG_WARNING, "Don't know how to respond via '%s'\n", via);
14226                         return;
14227                 }
14228                 pt = strchr(c, ':');


Seems like we're looking for the first colon.

Via: SIP/2.0/TCP [2620:0:2ef0:7070:250:60ff:fe03:32b7]:5060;branch=z9hG4bK4882ebf2298267bc4ba97d222289760c.1;rport


In this case, port would propably be 0 and not 5060...
Comments:By: Simon Perreault (sperreault) 2010-07-09 08:34:58

This patch should fix it. Didn't test it, only verified that it compiles.

By: Mark Michelson (mmichelson) 2010-07-09 14:43:33

Good catch, Olle. Thanks for the Quick patch, Simon. Patch looks correct to me.

By: Digium Subversion (svnbot) 2010-07-09 14:46:20

Repository: asterisk
Revision: 275308

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r275308 | mmichelson | 2010-07-09 14:46:19 -0500 (Fri, 09 Jul 2010) | 12 lines

Fix port parsing in check_via.

If a Via header contained an IPv6 address, we would not properly parse
the port. We would instead get the information after the first colon in
the address.

(closes issue ASTERISK-16341)
Reported by: oej
Patches:
     diff uploaded by sperreault (license )


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

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

By: Digium Subversion (svnbot) 2010-07-09 14:47:54

Repository: asterisk
Revision: 275308

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r275308 | mmichelson | 2010-07-09 14:46:20 -0500 (Fri, 09 Jul 2010) | 12 lines

Fix port parsing in check_via.

If a Via header contained an IPv6 address, we would not properly parse
the port. We would instead get the information after the first colon in
the address.

(closes issue ASTERISK-16341)
Reported by: oej
Patches:
     diff uploaded by sperreault (license 252)


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

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