mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Fix parsing of IPv6 address literals in outboundproxy
(closes issue #17757) Reported by: oej Patches: 17757.diff uploaded by sperreault (license 252) sip.conf.diff uploaded by sperreault (license 252) Tested by: oej git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@281687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -661,16 +661,18 @@ int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum s
|
||||
else
|
||||
line = *hostname;
|
||||
|
||||
if ((port = strrchr(line, ':'))) {
|
||||
*port++ = '\0';
|
||||
if (ast_sockaddr_split_hostport(line, hostname, &port, 0) == 0) {
|
||||
ast_log(LOG_WARNING, "Cannot parse host '%s' on line %d of sip.conf.\n",
|
||||
line, lineno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (port) {
|
||||
if (!sscanf(port, "%5u", portnum)) {
|
||||
ast_log(LOG_NOTICE, "'%s' is not a valid port number on line %d of sip.conf. using default.\n", port, lineno);
|
||||
port = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!port) {
|
||||
} else {
|
||||
if (*transport & SIP_TRANSPORT_TLS) {
|
||||
*portnum = STANDARD_TLS_PORT;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user