listen: check if AI_ADDRCONFIG is defined
AI_ADDRCONFIG is not available on all operating systems. Check if it is defined in the current build environment.
This commit is contained in:
parent
ac0af91912
commit
6902ff2084
|
@ -190,7 +190,10 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
|
|||
DEBUG("binding to address for %s\n", param->value);
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
#ifdef AI_ADDRCONFIG
|
||||
hints.ai_flags |= AI_ADDRCONFIG;
|
||||
#endif
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
|
|
Loading…
Reference in New Issue