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.
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;
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;