summaryrefslogtreecommitdiff
path: root/channels/sip
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:34 -0500
commit3ec9cf7d6abf589ebca8d56c5e7800b73b825eb1 (patch)
tree54c687f08d6b5200fb6b38a323c375fb6617809f /channels/sip
parent52f413f7096b4c6b9cc577aad60b6442e926508d (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
Diffstat (limited to 'channels/sip')
-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 1541d7c25..298b8cb95 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);