|
@@ -254,13 +254,15 @@ int corex_send(sip_msg_t *msg, gparam_t *pu, enum sip_protos proto)
|
|
ret=E_BUG;
|
|
ret=E_BUG;
|
|
goto error;
|
|
goto error;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
u = &next_hop;
|
|
u = &next_hop;
|
|
u->port_no = 5060;
|
|
u->port_no = 5060;
|
|
u->host = dest;
|
|
u->host = dest;
|
|
- p = memchr(dest.s, ':', dest.len);
|
|
|
|
|
|
+ p = dest.s;
|
|
|
|
+ /* detect ipv6 */
|
|
|
|
+ p = memchr(p, ']', dest.len);
|
|
|
|
+ if (p) p++;
|
|
|
|
+ p = memchr(p, ':', dest.len);
|
|
if (p)
|
|
if (p)
|
|
{
|
|
{
|
|
u->host.len = p - dest.s;
|
|
u->host.len = p - dest.s;
|