mirror of
https://github.com/mirror/wget.git
synced 2025-02-03 16:20:11 +08: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>
|
2003-11-15 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
* host.c: Don't refer to the now-removed function
|
* host.c: Don't refer to the now-removed function
|
||||||
|
@ -575,16 +575,19 @@ lookup_host (const char *host, int flags)
|
|||||||
|
|
||||||
xzero (hints);
|
xzero (hints);
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
hints.ai_family = AF_UNSPEC;
|
|
||||||
if (opt.ipv4_only && !opt.ipv6_only)
|
if (opt.ipv4_only && !opt.ipv6_only)
|
||||||
hints.ai_family = AF_INET;
|
hints.ai_family = AF_INET;
|
||||||
else if (opt.ipv6_only && !opt.ipv4_only)
|
else if (opt.ipv6_only && !opt.ipv4_only)
|
||||||
hints.ai_family = AF_INET6;
|
hints.ai_family = AF_INET6;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hints.ai_family = AF_UNSPEC;
|
||||||
#ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG
|
#ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG
|
||||||
/* Use AI_ADDRCONFIG where available. See init.c:defaults(). */
|
/* Use AI_ADDRCONFIG if available and if specific family isn't
|
||||||
|
explicitly requested. See init.c:defaults(). */
|
||||||
hints.ai_flags |= AI_ADDRCONFIG;
|
hints.ai_flags |= AI_ADDRCONFIG;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
if (flags & LH_BIND)
|
if (flags & LH_BIND)
|
||||||
hints.ai_flags |= AI_PASSIVE;
|
hints.ai_flags |= AI_PASSIVE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user