summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Sauerteig <ffs@ccn.net>2015-10-06 19:40:22 +0200
committerRichard Mudgett <rmudgett@digium.com>2015-10-06 16:34:07 -0500
commitf939e2bd48598d721aa18af8182b7b6b91a9fe95 (patch)
tree6a9641e52b51b7c48e5db5175e80f817a47f99f4
parent41b0e516e226b968ebc1af8b79bf38ede1b8c4a7 (diff)
chan_sip: Fix port parsing for IPv6 addresses in SIP Via headers.
If a Via header containes an IPv6 address and a port number is ommitted, as it is the standard port, we now leave the port empty and to not set it to the value after the first colon of the IPv6 address. ASTERISK-25443 #close Change-Id: Ie3c2f05471cd006bf04ed15598589c09577b1e70
-rw-r--r--channels/sip/reqresp_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index e5c1ff2bc..31832a33a 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -2420,7 +2420,7 @@ struct sip_via *parse_via(const char *header)
/* store the port, we have to handle ipv6 addresses containing ':'
* characters gracefully */
- if (((parm = strchr(v->sent_by, ']')) && *(++parm) == ':') || (parm = strchr(v->sent_by, ':'))) {
+ if (((parm = strchr(v->sent_by, ']')) && *(++parm) == ':') || (!(parm = strchr(v->sent_by, ']')) && (parm = strchr(v->sent_by, ':')))) {
char *endptr;
v->port = strtol(++parm, &endptr, 10);