From: Ruben Kerkhof Date: Tue, 2 Aug 2016 13:19:49 +0000 (+0200) Subject: treewide: stop checking for AI_PASSIVE X-Git-Tag: collectd-5.6.0~127^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=fe62d5e7df4374616d17246889d61a57ef46a1c4;p=collectd.git treewide: stop checking for AI_PASSIVE I think it's safe to assume that if you have getaddrinfo, you have AI_PASSIVE. My copy of Stevens from 1998 already describes it. --- diff --git a/src/gmond.c b/src/gmond.c index b6971b1a..9dda84c9 100644 --- a/src/gmond.c +++ b/src/gmond.c @@ -224,10 +224,7 @@ static int create_sockets (socket_entry_t **ret_sockets, /* {{{ */ if (*ret_sockets != NULL) return (EINVAL); - ai_hints.ai_flags = AI_ADDRCONFIG; -#ifdef AI_PASSIVE - ai_hints.ai_flags |= AI_PASSIVE; -#endif + 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; diff --git a/src/network.c b/src/network.c index 4f13aa4a..baeb9159 100644 --- a/src/network.c +++ b/src/network.c @@ -2256,10 +2256,7 @@ static int sockent_server_listen (sockent_t *se) /* {{{ */ 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 + 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;