Skip to content

Commit

Permalink
corex: fix regression introduced with detection of ipv6 for send()
Browse files Browse the repository at this point in the history
- reported by Paul Arnold, GH #496

(cherry picked from commit 8e20a3c)
  • Loading branch information
miconda committed Feb 5, 2016
1 parent 83e842d commit 160ec06
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/corex/corex_lib.c
Expand Up @@ -258,11 +258,14 @@ int corex_send(sip_msg_t *msg, gparam_t *pu, enum sip_protos proto)
u = &next_hop;
u->port_no = 5060;
u->host = dest;
p = dest.s;
/* detect ipv6 */
p = memchr(p, ']', dest.len);
if (p) p++;
p = memchr(p, ':', dest.len);
p = memchr(dest.s, ']', dest.len);
if (p) {
p++;
p = memchr(p, ':', dest.s + dest.len - p);
} else {
p = memchr(dest.s, ':', dest.len);
}
if (p)
{
u->host.len = p - dest.s;
Expand Down

0 comments on commit 160ec06

Please sign in to comment.