From: octo Date: Thu, 2 Feb 2006 07:17:32 +0000 (+0000) Subject: Make `AI_ADDRCONFIG' and `AI_PASSIVE' conditional (use them only if they exist..) X-Git-Tag: collectd-3.8.0~22 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=844b2be7ed10e1d2208da731dbffa15848963162;p=collectd.git Make `AI_ADDRCONFIG' and `AI_PASSIVE' conditional (use them only if they exist..) --- diff --git a/src/network.c b/src/network.c index 5f9aa741..cf0a0a38 100644 --- a/src/network.c +++ b/src/network.c @@ -218,7 +218,13 @@ int network_create_socket (const char *node, const char *service) socklist_tail = socklist_tail->next; memset (&ai_hints, '\0', sizeof (ai_hints)); - ai_hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; + ai_hints.ai_flags = 0; +#ifdef AI_PASSIVE + ai_hints.ai_flags |= AI_PASSIVE; +#endif +#ifdef AI_ADDRCONFIG + ai_hints.ai_flags |= AI_ADDRCONFIG; +#endif ai_hints.ai_family = PF_UNSPEC; ai_hints.ai_socktype = SOCK_DGRAM; ai_hints.ai_protocol = IPPROTO_UDP;