Module: kamailio
Branch: master
Commit: 027495fb6ac7c8f50ff9945c209bc9f7ac98d991
URL:
https://github.com/kamailio/kamailio/commit/027495fb6ac7c8f50ff9945c209bc9f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-10-21T09:51:54+02:00
corex: detect ipv6 for send*() functions
---
Modified: modules/corex/corex_lib.c
---
Diff:
https://github.com/kamailio/kamailio/commit/027495fb6ac7c8f50ff9945c209bc9f…
Patch:
https://github.com/kamailio/kamailio/commit/027495fb6ac7c8f50ff9945c209bc9f…
---
diff --git a/modules/corex/corex_lib.c b/modules/corex/corex_lib.c
index dcbe550..21593f5 100644
--- a/modules/corex/corex_lib.c
+++ b/modules/corex/corex_lib.c
@@ -254,13 +254,15 @@ int corex_send(sip_msg_t *msg, gparam_t *pu, enum sip_protos proto)
ret=E_BUG;
goto error;
}
- }
- else
- {
+ } else {
u = &next_hop;
u->port_no = 5060;
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)
{
u->host.len = p - dest.s;