mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Specify AI_ADDRCONFIG only when the address family is not explicitly
requested.
This commit is contained in:
parent
98349dee6f
commit
dcc890b007
@ -1,3 +1,10 @@
|
||||
2003-11-15 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* host.c (lookup_host): Use AI_ADDRCONFIG only if the family is
|
||||
unspecified. This ensures that specifying `--no-inet4' on systems
|
||||
where IPv6 resolves, but doesn't work behaves the same regardless
|
||||
of the availability of AI_ADDRCONFIG.
|
||||
|
||||
2003-11-15 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* host.c: Don't refer to the now-removed function
|
||||
|
11
src/host.c
11
src/host.c
@ -575,16 +575,19 @@ lookup_host (const char *host, int flags)
|
||||
|
||||
xzero (hints);
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
if (opt.ipv4_only && !opt.ipv6_only)
|
||||
hints.ai_family = AF_INET;
|
||||
else if (opt.ipv6_only && !opt.ipv4_only)
|
||||
hints.ai_family = AF_INET6;
|
||||
|
||||
else
|
||||
{
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
#ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG
|
||||
/* Use AI_ADDRCONFIG where available. See init.c:defaults(). */
|
||||
hints.ai_flags |= AI_ADDRCONFIG;
|
||||
/* Use AI_ADDRCONFIG if available and if specific family isn't
|
||||
explicitly requested. See init.c:defaults(). */
|
||||
hints.ai_flags |= AI_ADDRCONFIG;
|
||||
#endif
|
||||
}
|
||||
if (flags & LH_BIND)
|
||||
hints.ai_flags |= AI_PASSIVE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user