summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc6f54c)
raw | patch | inline | side by side (parent: dc6f54c)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Tue, 2 Aug 2016 13:17:11 +0000 (15:17 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Tue, 2 Aug 2016 13:17:11 +0000 (15:17 +0200) |
It has been in RFC 3494 since 2003 and all the platforms
we care about have it.
we care about have it.
15 files changed:
diff --git a/src/gmond.c b/src/gmond.c
index 47158c975b800b823926e325200a85a18de4fa4d..b6971b1a685be1625a1b0b508d9a9c535356867e 100644 (file)
--- a/src/gmond.c
+++ b/src/gmond.c
if (*ret_sockets != NULL)
return (EINVAL);
+ ai_hints.ai_flags = AI_ADDRCONFIG;
#ifdef AI_PASSIVE
ai_hints.ai_flags |= AI_PASSIVE;
-#endif
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
#endif
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
diff --git a/src/hddtemp.c b/src/hddtemp.c
index c32aa35827744f433fe6280854b3e658c5c170ff..bda41a192a895e51d7bcef600cc25c61c3bf0f49 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = IPPROTO_TCP;
index f5eda6d2222957400258ada8e353422997ddd2b0..58c4e6711f7282438bac4c1af5a8f0e70748480e 100644 (file)
addr_copy[sizeof(addr_copy) - 1] = '\0';
addr = addr_copy;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
index 8e6bab86823efd3c6a4b23aa6d794681d999baa4..fdca6e45724b8f6f0f3bcd47a26dca6700b804fa 100644 (file)
if (srv->fd >= 0)
server_close_socket (srv);
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
diff --git a/src/mbmon.c b/src/mbmon.c
index ccececd758b3971756c999c231dad971e923d27a..bec6bdf2baa8f229506f5911a766c0bd1521caf8 100644 (file)
--- a/src/mbmon.c
+++ b/src/mbmon.c
struct addrinfo *ai_list, *ai_ptr;
int ai_return;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = IPPROTO_TCP;
diff --git a/src/memcached.c b/src/memcached.c
index faff5793459e8ea1c56a79422ce26485e0925b2c..17a77609e3aa0eaf138a52343c03939347e33703 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
int status;
int fd = -1;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = 0;
diff --git a/src/modbus.c b/src/modbus.c
index 809194b4c51538d39a3f25180d8be5df77ebc843..c58cb3982c18e40d25a3f4aad5630fe34f55d9de 100644 (file)
--- a/src/modbus.c
+++ b/src/modbus.c
if ((host == NULL) || (address == NULL))
return (EINVAL);
-#if AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
/* XXX: libmodbus can only handle IPv4 addresses. */
ai_hints.ai_family = AF_INET;
ai_hints.ai_addr = NULL;
diff --git a/src/network.c b/src/network.c
index 5a8a88efe388317cd48288ad97e63412b8b6acef..4f13aa4ade8a5f7824f00c0da644764d5ed5bac8 100644 (file)
--- a/src/network.c
+++ b/src/network.c
if (client->fd >= 0 && !reconnect) /* already connected and not stale*/
return (0);
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
ai_hints.ai_protocol = IPPROTO_UDP;
DEBUG ("network plugin: sockent_server_listen: node = %s; service = %s;",
node, service);
+ ai_hints.ai_flags = AI_ADDRCONFIG;
#ifdef AI_PASSIVE
- ai_hints.ai_flags |= AI_PASSIVE;
-#endif
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
+ ai_hints.ai_flags |= AI_PASSIVE;
#endif
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
diff --git a/src/ntpd.c b/src/ntpd.c
index f7b57ba30ce30ecc3c7826f879d2d4bb99629028..f36c50055750d017cdef2f03e207e70f444fccad 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
if (strlen (port) == 0)
port = NTPD_DEFAULT_PORT;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
ai_hints.ai_protocol = IPPROTO_UDP;
diff --git a/src/olsrd.c b/src/olsrd.c
index 2b7e767e7702151762880f744823e0e9c4ea3c81..2a4bf03b329679c604e999278348639fd315b035 100644 (file)
--- a/src/olsrd.c
+++ b/src/olsrd.c
FILE *fh;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = PF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
ai_hints.ai_protocol = IPPROTO_TCP;
diff --git a/src/statsd.c b/src/statsd.c
index 1eb8cb94c59df032f1615909a1341ec63cab432c..5df072d3f3e2bd939b5bec3577660a363c3dbda8 100644 (file)
--- a/src/statsd.c
+++ b/src/statsd.c
char const *service = (conf_service != NULL)
? conf_service : STATSD_DEFAULT_SERVICE;
- ai_hints.ai_flags = AI_PASSIVE;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_DGRAM;
diff --git a/src/teamspeak2.c b/src/teamspeak2.c
index cf093c5feec35debf969b27d4c1fac8b432b20ba..89578f0e4642a61a4b3d1c11e0953c8015b37fe3 100644 (file)
--- a/src/teamspeak2.c
+++ b/src/teamspeak2.c
}
/* Get all addrs for this hostname */
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
diff --git a/src/write_graphite.c b/src/write_graphite.c
index 25c7a637759daa0a78ec66f5f080ffd99ef22893..a22a2365f90d9746ba68cd910aef11021b1ad526 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
return (EAGAIN);
cb->last_connect_time = now;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
if (0 == strcasecmp ("tcp", cb->protocol))
diff --git a/src/write_sensu.c b/src/write_sensu.c
index d37792b4f5e589ef5d764e3b571c4d87e4215692..99fca173bb7780e83cb400762cc37392dabc4667 100644 (file)
--- a/src/write_sensu.c
+++ b/src/write_sensu.c
host->res = NULL;
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
-#ifdef AI_ADDRCONFIG
- hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ hints.ai_flags = AI_ADDRCONFIG;
node = (host->node != NULL) ? host->node : SENSU_HOST;
service = (host->service != NULL) ? host->service : SENSU_PORT;
diff --git a/src/write_tsdb.c b/src/write_tsdb.c
index a044b6819a64a24ef51cfed8c3235422ef60dcf6..7a8f851f285398bfb504bb02e72bf78b0a4ad3c2 100644 (file)
--- a/src/write_tsdb.c
+++ b/src/write_tsdb.c
if (cb->sock_fd > 0)
return 0;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
+ ai_hints.ai_flags = AI_ADDRCONFIG;
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;