listen: enable AI_PASSIVE
The getaddrinfo() flag AI_PASSIVE should be used when resolving addresses for the bind() system call.
This commit is contained in:
parent
c06ce44768
commit
ac0af91912
@ -190,7 +190,7 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
|
|||||||
DEBUG("binding to address for %s\n", param->value);
|
DEBUG("binding to address for %s\n", param->value);
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_flags = AI_ADDRCONFIG;
|
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
||||||
hints.ai_family = PF_UNSPEC;
|
hints.ai_family = PF_UNSPEC;
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
hints.ai_protocol = IPPROTO_TCP;
|
hints.ai_protocol = IPPROTO_TCP;
|
||||||
|
Loading…
Reference in New Issue
Block a user