[Asterisk-code-review] chan sip: Fix port parsing for IPv6 addresses in SIP Via hea... (asterisk[13])
Richard Mudgett
asteriskteam at digium.com
Tue Oct 6 16:34:07 CDT 2015
Richard Mudgett has uploaded a new change for review.
https://gerrit.asterisk.org/1399
Change subject: chan_sip: Fix port parsing for IPv6 addresses in SIP Via headers.
......................................................................
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
---
M channels/sip/reqresp_parser.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/99/1399/1
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index e5c1ff2..31832a3 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -2420,7 +2420,7 @@
/* 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);
--
To view, visit https://gerrit.asterisk.org/1399
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3c2f05471cd006bf04ed15598589c09577b1e70
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Florian Sauerteig <ffs at ccn.net>
More information about the asterisk-code-review
mailing list