From fe62d5e7df4374616d17246889d61a57ef46a1c4 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 2 Aug 2016 15:19:49 +0200 Subject: [PATCH] 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. --- src/gmond.c | 5 +---- src/network.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) 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; -- 2.11.0