Commit 3663624d authored by Jeremy C. Reed's avatar Jeremy C. Reed

[master] getaddrinfo portability

check for AI_ADDRCONFIG

This was from the trac1526 branch.
parent 9a2f3954
......@@ -1888,7 +1888,11 @@ getserveraddr(const int flags)
service = "547";
}
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV | flags;
hints.ai_flags = AI_NUMERICSERV | flags;
#if defined(AI_ADDRCONFIG)
hints.ai_flags |= AI_ADDRCONFIG;
#endif
hints.ai_protocol = IPPROTO_UDP;
ret = getaddrinfo(servername, service, &hints, &res);
......@@ -1985,7 +1989,10 @@ getlocaladdr(void)
service = "546";
}
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV;
hints.ai_flags = AI_NUMERICSERV;
#if defined(AI_ADDRCONFIG)
hints.ai_flags |= AI_ADDRCONFIG;
#endif
hints.ai_protocol = IPPROTO_UDP;
ret = getaddrinfo(localname, service, &hints, &res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment