[Asterisk-code-review] chan sip: Fix port parsing for IPv6 addresses in SIP Via hea... (asterisk[11])
Matt Jordan
asteriskteam at digium.com
Tue Oct 6 17:09:28 CDT 2015
Matt Jordan has submitted this change and it was merged.
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(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Matt Jordan: Looks good to me, approved
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index 42bb04d..9b435d0 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -2323,7 +2323,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/1391
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3c2f05471cd006bf04ed15598589c09577b1e70
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Florian Sauerteig <ffs at ccn.net>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list