Module: kamailio
Branch: master
Commit: 20cd36c671972d9ebb180884b70e1fd91a92a1cc
URL:
https://github.com/kamailio/kamailio/commit/20cd36c671972d9ebb180884b70e1fd…
Author: Mikko Lehto <mslehto(a)iki.fi>
Committer: Mikko Lehto <mslehto(a)iki.fi>
Date: 2016-01-26T00:28:43+02:00
modules/statsd: enables IPv6 by using result from getaddrinfo()
---
Modified: modules/statsd/lib_statsd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/20cd36c671972d9ebb180884b70e1fd…
Patch:
https://github.com/kamailio/kamailio/commit/20cd36c671972d9ebb180884b70e1fd…
---
diff --git a/modules/statsd/lib_statsd.c b/modules/statsd/lib_statsd.c
index 6492ef2..dedb41b 100644
--- a/modules/statsd/lib_statsd.c
+++ b/modules/statsd/lib_statsd.c
@@ -44,7 +44,7 @@ bool statsd_connect(void){
return false;
}
- statsd_socket.sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ statsd_socket.sock = socket(serverAddr->ai_family, SOCK_DGRAM, IPPROTO_UDP);
if (statsd_socket.sock == 0 ){
LM_ERR("Statsd: could not initiate a connect to statsd\n");
return false;
@@ -52,6 +52,7 @@ bool statsd_connect(void){
rc = connect(
statsd_socket.sock, serverAddr->ai_addr, serverAddr->ai_addrlen);
+ freeaddrinfo(serverAddr);
if (rc < 0){
LM_ERR("Statsd: could not initiate a connect to statsd\n");
return false;