提交 87edbed6 authored 作者: Brian West's avatar Brian West

FS-535: be more careful and catch ipv6 edge case

上级 22047f93
......@@ -5740,6 +5740,10 @@ char *sofia_glue_get_register_host(const char *uri)
const char *s;
char *p = NULL;
if (zstr(uri)) {
return NULL;
}
if ((s = switch_stristr("sip:", uri))) {
s += 4;
} else if ((s = switch_stristr("sips:", uri))) {
......@@ -5755,8 +5759,11 @@ char *sofia_glue_get_register_host(const char *uri)
/* remove port for register_host for testing nat acl take into account
ipv6 addresses which are required to have brackets around the addr
*/
if ((p = strchr(register_host, ']')) && (*(p + 1) == ':')) {
if ((p = strchr(register_host, ']'))) {
if (*(p + 1) == ':') {
*(p + 1) = '\0';
}
} else {
if ((p = strrchr(register_host, ':'))) {
*p = '\0';
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论