[sr-dev] git:master:20cd36c6: modules/statsd: enables IPv6 by using result from getaddrinfo()

Mikko Lehto mslehto at iki.fi
Fri Jan 29 10:04:16 CET 2016


Module: kamailio
Branch: master
Commit: 20cd36c671972d9ebb180884b70e1fd91a92a1cc
URL: https://github.com/kamailio/kamailio/commit/20cd36c671972d9ebb180884b70e1fd91a92a1cc

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Mikko Lehto <mslehto at 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/20cd36c671972d9ebb180884b70e1fd91a92a1cc.diff
Patch: https://github.com/kamailio/kamailio/commit/20cd36c671972d9ebb180884b70e1fd91a92a1cc.patch

---

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;




More information about the sr-dev mailing list