summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe62d5e)
raw | patch | inline | side by side (parent: fe62d5e)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Tue, 2 Aug 2016 14:27:17 +0000 (16:27 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Wed, 3 Aug 2016 08:05:11 +0000 (10:05 +0200) |
21 files changed:
src/apcups.c | patch | blob | history | |
src/chrony.c | patch | blob | history | |
src/daemon/collectd.c | patch | blob | history | |
src/daemon/common.c | patch | blob | history | |
src/gmond.c | patch | blob | history | |
src/hddtemp.c | patch | blob | history | |
src/libcollectdclient/client.c | patch | blob | history | |
src/libcollectdclient/network.c | patch | blob | history | |
src/mbmon.c | patch | blob | history | |
src/memcached.c | patch | blob | history | |
src/modbus.c | patch | blob | history | |
src/network.c | patch | blob | history | |
src/ntpd.c | patch | blob | history | |
src/olsrd.c | patch | blob | history | |
src/pinba.c | patch | blob | history | |
src/statsd.c | patch | blob | history | |
src/teamspeak2.c | patch | blob | history | |
src/write_graphite.c | patch | blob | history | |
src/write_sensu.c | patch | blob | history | |
src/write_tsdb.c | patch | blob | history | |
src/zookeeper.c | patch | blob | history |
diff --git a/src/apcups.c b/src/apcups.c
index 84249339a2261f7f7f6ca4f429f1d7911687c1f8..aa0be835cc7d9f870960f01e8d136c14e1c1df7f 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
{
int sd;
int status;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_return;
struct addrinfo *ai_list;
/* TODO: Change this to `AF_UNSPEC' if apcupsd can handle IPv6 */
- ai_hints.ai_family = AF_INET;
- ai_hints.ai_socktype = SOCK_STREAM;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_INET,
+ .ai_socktype = SOCK_STREAM
+ };
status = getaddrinfo (node, service, &ai_hints, &ai_return);
if (status != 0)
diff --git a/src/chrony.c b/src/chrony.c
index 4a09753ffc3ee2b3ee151b5841ad670dc6b86e5a..9c40dd33950e310dbbec9d5551a8704394340244 100644 (file)
--- a/src/chrony.c
+++ b/src/chrony.c
connect_client(const char *p_hostname,
const char *p_service, int p_family, int p_socktype)
{
- struct addrinfo hints = { 0 };
- struct addrinfo *res = NULL, *ressave = NULL;
+ struct addrinfo *res, *ressave;
int n, sockfd;
- hints.ai_family = p_family;
- hints.ai_socktype = p_socktype;
+ struct addrinfo ai_hints = {
+ .ai_family = p_family,
+ .ai_socktype = p_socktype
+ };
- n = getaddrinfo(p_hostname, p_service, &hints, &res);
+ n = getaddrinfo(p_hostname, p_service, &ai_hints, &res);
if (n < 0)
{
diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c
index 840520887b3352a70dc19d6243b9c8fe58f81430..3a6fe1e962abb033a06ce00d7e78399efa6462b1 100644 (file)
--- a/src/daemon/collectd.c
+++ b/src/daemon/collectd.c
{
const char *str;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
int status;
if (IS_FALSE (str))
return (0);
- ai_hints.ai_flags = AI_CANONNAME;
+ struct addrinfo ai_hints = {
+ .ai_flags = AI_CANONNAME
+ };
status = getaddrinfo (hostname_g, NULL, &ai_hints, &ai_list);
if (status != 0)
diff --git a/src/daemon/common.c b/src/daemon/common.c
index 9da47755034038ebc0025343b9e3b55a6b2f1796..b3bc753286fd569f504e7db820ca75c68fd51a00 100644 (file)
--- a/src/daemon/common.c
+++ b/src/daemon/common.c
{
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
- struct addrinfo ai_hints = { 0 };
int status;
int service_number;
return (-1);
ai_list = NULL;
- ai_hints.ai_family = AF_UNSPEC;
+
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC
+ };
status = getaddrinfo (/* node = */ NULL, service_name,
&ai_hints, &ai_list);
diff --git a/src/gmond.c b/src/gmond.c
index 9dda84c91c784c1337be99c0da983ff646070ac9..cfe7eaf4f8e3b438fdc1fcb3ce2598d74132b6b4 100644 (file)
--- a/src/gmond.c
+++ b/src/gmond.c
size_t *ret_sockets_num,
const char *node, const char *service, int listen)
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
int ai_return;
if (*ret_sockets != NULL)
return (EINVAL);
- ai_hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
- ai_hints.ai_protocol = IPPROTO_UDP;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG | AI_PASSIVE,
+ .ai_protocol = IPPROTO_UDP,
+ .ai_socktype = SOCK_DGRAM
+ };
ai_return = getaddrinfo (node, service, &ai_hints, &ai_list);
if (ai_return != 0)
diff --git a/src/hddtemp.c b/src/hddtemp.c
index bda41a192a895e51d7bcef600cc25c61c3bf0f49..1b7ed329a9a088360730abc44fd59eee356da2d5 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
const char *host;
const char *port;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = PF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
- ai_hints.ai_protocol = IPPROTO_TCP;
-
host = hddtemp_host;
if (host == NULL)
host = HDDTEMP_DEF_HOST;
if (strlen (port) == 0)
port = HDDTEMP_DEF_PORT;
+ struct addrinfo ai_hints = {
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_family = PF_UNSPEC,
+ .ai_protocol = IPPROTO_TCP,
+ .ai_socktype = SOCK_STREAM
+ };
+
if ((ai_return = getaddrinfo (host, port, &ai_hints, &ai_list)) != 0)
{
char errbuf[1024];
index 58c4e6711f7282438bac4c1af5a8f0e70748480e..fea9360ede7083bf2d0897e512d7af4f60a7a3e9 100644 (file)
@@ -420,7 +420,6 @@ static int lcc_open_unixsocket (lcc_connection_t *c, const char *path) /* {{{ */
static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */
const char *addr_orig)
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_res;
struct addrinfo *ai_ptr;
char addr_copy[NI_MAXHOST];
addr_copy[sizeof(addr_copy) - 1] = '\0';
addr = addr_copy;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
-
port = NULL;
if (*addr == '[') /* IPv6+port format */
{
}
ai_res = NULL;
+
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_STREAM
+ };
+
status = getaddrinfo (addr,
port == NULL ? LCC_DEFAULT_PORT : port,
&ai_hints, &ai_res);
index fdca6e45724b8f6f0f3bcd47a26dca6700b804fa..afbee6e8ea5b2e4231040aac59177f9b59b6cfdf 100644 (file)
static int server_open_socket (lcc_server_t *srv) /* {{{ */
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list = NULL;
struct addrinfo *ai_ptr;
int status;
if (srv->fd >= 0)
server_close_socket (srv);
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_DGRAM
+ };
status = getaddrinfo (srv->node, srv->service, &ai_hints, &ai_list);
if (status != 0)
diff --git a/src/mbmon.c b/src/mbmon.c
index bec6bdf2baa8f229506f5911a766c0bd1521caf8..1f0a0d638814bdd2cd31b0255df039d7ca388914 100644 (file)
--- a/src/mbmon.c
+++ b/src/mbmon.c
const char *host;
const char *port;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = PF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
- ai_hints.ai_protocol = IPPROTO_TCP;
-
host = mbmon_host;
if (host == NULL)
host = MBMON_DEF_HOST;
if (port == NULL)
port = MBMON_DEF_PORT;
+ struct addrinfo ai_hints = {
+ .ai_family = PF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_protocol = IPPROTO_TCP,
+ .ai_socktype = SOCK_STREAM
+ };
+
if ((ai_return = getaddrinfo (host, port, &ai_hints, &ai_list)) != 0)
{
char errbuf[1024];
diff --git a/src/memcached.c b/src/memcached.c
index 17a77609e3aa0eaf138a52343c03939347e33703..c0c9e70c5abff946704154d2796fa24e2484d551 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
const char *host;
const char *port;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list, *ai_ptr;
int status;
int fd = -1;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
- ai_hints.ai_protocol = 0;
-
host = (st->host != NULL) ? st->host : MEMCACHED_DEF_HOST;
port = (st->port != NULL) ? st->port : MEMCACHED_DEF_PORT;
ai_list = NULL;
+
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_STREAM
+ };
+
status = getaddrinfo (host, port, &ai_hints, &ai_list);
if (status != 0)
{
diff --git a/src/modbus.c b/src/modbus.c
index c58cb3982c18e40d25a3f4aad5630fe34f55d9de..a2150600902bb789ccae2d9437a66ec4e0cdecfe 100644 (file)
--- a/src/modbus.c
+++ b/src/modbus.c
{
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
- struct addrinfo ai_hints = { 0 };
int status;
if ((host == NULL) || (address == NULL))
return (EINVAL);
- ai_hints.ai_flags = AI_ADDRCONFIG;
- /* XXX: libmodbus can only handle IPv4 addresses. */
- ai_hints.ai_family = AF_INET;
- ai_hints.ai_addr = NULL;
- ai_hints.ai_canonname = NULL;
- ai_hints.ai_next = NULL;
-
ai_list = NULL;
+
+ struct addrinfo ai_hints = {
+ /* XXX: libmodbus can only handle IPv4 addresses. */
+ .ai_family = AF_INET,
+ .ai_flags = AI_ADDRCONFIG
+ };
+
status = getaddrinfo (address, /* service = */ NULL,
&ai_hints, &ai_list);
if (status != 0)
diff --git a/src/network.c b/src/network.c
index baeb9159dd829c342f70a2395926a000f9073a14..11c39a7815bb88d1749eed94cbc1fb215388a61d 100644 (file)
--- a/src/network.c
+++ b/src/network.c
static c_complain_t complaint = C_COMPLAIN_INIT_STATIC;
struct sockent_client *client;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list = NULL, *ai_ptr;
int status;
_Bool reconnect = 0;
if (client->fd >= 0 && !reconnect) /* already connected and not stale*/
return (0);
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
- ai_hints.ai_protocol = IPPROTO_UDP;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_protocol = IPPROTO_UDP,
+ .ai_socktype = SOCK_DGRAM
+ };
status = getaddrinfo (se->node,
(se->service != NULL) ? se->service : NET_DEFAULT_PORT,
/* Open the file descriptors for a initialized sockent structure. */
static int sockent_server_listen (sockent_t *se) /* {{{ */
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list, *ai_ptr;
int status;
DEBUG ("network plugin: sockent_server_listen: node = %s; service = %s;",
node, service);
- ai_hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
- ai_hints.ai_protocol = IPPROTO_UDP;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG | AI_PASSIVE,
+ .ai_protocol = IPPROTO_UDP,
+ .ai_socktype = SOCK_DGRAM
+ };
status = getaddrinfo (node, service, &ai_hints, &ai_list);
if (status != 0)
diff --git a/src/ntpd.c b/src/ntpd.c
index f36c50055750d017cdef2f03e207e70f444fccad..e075a208b745790ac011a0efe7e6dbaef34395e9 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
const char *host;
const char *port;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
int status;
if (strlen (port) == 0)
port = NTPD_DEFAULT_PORT;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = PF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
- ai_hints.ai_protocol = IPPROTO_UDP;
+ struct addrinfo ai_hints = {
+ .ai_family = PF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_protocol = IPPROTO_UDP,
+ .ai_socktype = SOCK_DGRAM
+ };
if ((status = getaddrinfo (host, port, &ai_hints, &ai_list)) != 0)
{
diff --git a/src/olsrd.c b/src/olsrd.c
index 2a4bf03b329679c604e999278348639fd315b035..976793fe38fbc86856346df85050aa0f56be0104 100644 (file)
--- a/src/olsrd.c
+++ b/src/olsrd.c
@@ -149,18 +149,20 @@ static size_t strtabsplit (char *string, char **fields, size_t size) /* {{{ */
static FILE *olsrd_connect (void) /* {{{ */
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
FILE *fh;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = PF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
- ai_hints.ai_protocol = IPPROTO_TCP;
-
ai_list = NULL;
+
+ struct addrinfo ai_hints = {
+ .ai_family = PF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_protocol = IPPROTO_TCP,
+ .ai_socktype = SOCK_STREAM
+ };
+
ai_return = getaddrinfo (olsrd_get_node (), olsrd_get_service (),
&ai_hints, &ai_list);
if (ai_return != 0)
diff --git a/src/pinba.c b/src/pinba.c
index 833fa1b8cdd4cc997363af376652748fe2dc49d1..6a4ebfcd24cc45e18a2838cd979dab993683cc6e 100644 (file)
--- a/src/pinba.c
+++ b/src/pinba.c
pinba_socket_t *s;
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
- struct addrinfo ai_hints = { 0 };
int status;
- ai_hints.ai_flags = AI_PASSIVE;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
- ai_hints.ai_addr = NULL;
- ai_hints.ai_canonname = NULL;
- ai_hints.ai_next = NULL;
-
if (node == NULL)
node = PINBA_DEFAULT_NODE;
service = PINBA_DEFAULT_SERVICE;
ai_list = NULL;
+
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_PASSIVE,
+ .ai_socktype = SOCK_DGRAM
+ };
+
status = getaddrinfo (node, service,
&ai_hints, &ai_list);
if (status != 0)
diff --git a/src/statsd.c b/src/statsd.c
index 5df072d3f3e2bd939b5bec3577660a363c3dbda8..285486d88cee53777c5289db1cd0e3cec632d1f8 100644 (file)
--- a/src/statsd.c
+++ b/src/statsd.c
struct pollfd *fds = NULL;
size_t fds_num = 0;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list = NULL;
struct addrinfo *ai_ptr;
int status;
char const *service = (conf_service != NULL)
? conf_service : STATSD_DEFAULT_SERVICE;
- ai_hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_DGRAM;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_PASSIVE | AI_ADDRCONFIG,
+ .ai_socktype = SOCK_DGRAM
+ };
status = getaddrinfo (node, service, &ai_hints, &ai_list);
if (status != 0)
diff --git a/src/teamspeak2.c b/src/teamspeak2.c
index 89578f0e4642a61a4b3d1c11e0953c8015b37fe3..5d534603a69148f1441a12e0146cb1cb1933f1a9 100644 (file)
--- a/src/teamspeak2.c
+++ b/src/teamspeak2.c
* Returns connected file objects or establishes the connection
* if it's not already present
*/
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_head;
struct addrinfo *ai_ptr;
int sd = -1;
}
/* Get all addrs for this hostname */
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_STREAM
+ };
status = getaddrinfo ((config_host != NULL) ? config_host : DEFAULT_HOST,
(config_port != NULL) ? config_port : DEFAULT_PORT,
diff --git a/src/write_graphite.c b/src/write_graphite.c
index a22a2365f90d9746ba68cd910aef11021b1ad526..efdd4d8a23206c6ab3ddae927f6d22422607e09b 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
static int wg_callback_init (struct wg_callback *cb)
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
cdtime_t now;
return (EAGAIN);
cb->last_connect_time = now;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG
+ };
if (0 == strcasecmp ("tcp", cb->protocol))
ai_hints.ai_socktype = SOCK_STREAM;
diff --git a/src/write_sensu.c b/src/write_sensu.c
index 99fca173bb7780e83cb400762cc37392dabc4667..63c6d998b2c2705460b9f41503b162bde58d318b 100644 (file)
--- a/src/write_sensu.c
+++ b/src/write_sensu.c
static int sensu_connect(struct sensu_host *host) /* {{{ */
{
int e;
- struct addrinfo *ai, hints;
+ struct addrinfo *ai;
char const *node;
char const *service;
// Resolve the target if we haven't done already
if (!(host->flags & F_READY)) {
- memset(&hints, 0, sizeof(hints));
memset(&service, 0, sizeof(service));
host->res = NULL;
- hints.ai_family = AF_INET;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_ADDRCONFIG;
node = (host->node != NULL) ? host->node : SENSU_HOST;
service = (host->service != NULL) ? host->service : SENSU_PORT;
- if ((e = getaddrinfo(node, service, &hints, &(host->res))) != 0) {
+ struct addrinfo ai_hints = {
+ .ai_family = AF_INET,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_STREAM
+ };
+
+ if ((e = getaddrinfo(node, service, &ai_hints, &(host->res))) != 0) {
ERROR("write_sensu plugin: Unable to resolve host \"%s\": %s",
node, gai_strerror(e));
return -1;
diff --git a/src/write_tsdb.c b/src/write_tsdb.c
index 7a8f851f285398bfb504bb02e72bf78b0a4ad3c2..fe418cf9e7d616f402b6defaad8d3bcd8482ea04 100644 (file)
--- a/src/write_tsdb.c
+++ b/src/write_tsdb.c
static int wt_callback_init(struct wt_callback *cb)
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
int status;
if (cb->sock_fd > 0)
return 0;
- ai_hints.ai_flags = AI_ADDRCONFIG;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
-
ai_list = NULL;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG,
+ .ai_socktype = SOCK_STREAM
+ };
+
status = getaddrinfo(node, service, &ai_hints, &ai_list);
if (status != 0)
{
diff --git a/src/zookeeper.c b/src/zookeeper.c
index a236c8ae66404bd5173c0be7e2537246e34511f4..a3b73628bdc44d76db44f73a91d475c97fbb552d 100644 (file)
--- a/src/zookeeper.c
+++ b/src/zookeeper.c
{
int sk = -1;
int status;
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai;
struct addrinfo *ai_list;
const char *host;
const char *port;
- ai_hints.ai_family = AF_UNSPEC;
- ai_hints.ai_socktype = SOCK_STREAM;
-
host = (zk_host != NULL) ? zk_host : ZOOKEEPER_DEF_HOST;
port = (zk_port != NULL) ? zk_port : ZOOKEEPER_DEF_PORT;
+
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_socktype = SOCK_STREAM
+ };
+
status = getaddrinfo (host, port, &ai_hints, &ai_list);
if (status != 0)
{