"Ángel González" <[email protected]> writes: > However, there's another easier thing to do for wget. Ulrich Drepper > strongly argues there that getaddrinfo() callers should use the > AI_ADDRCONFIG flag. wget is purposefully not using that flag [2] and > so even if disabling ipv6 [3] it still performs the two queries (and > produces the waiting behavior) whereas adding AI_ADDRCONFIG avoid it.
Note that you can disable IPv6 in Wget itself with --inet4-only or the equivalent .wgetrc command. That will cause Wget to request AF_INET family from getaddrinfo and (presumably) avoid the spurious lookup that causes problems. AI_ADDRCONFIG does the equivalent of --inet4-only and --inet6-only automatically, depending on which network interfaces are configured. When we tried using it some years ago, it caused a number of bugs because of the flag having been poorly implemented, both on Linux (including my primary development machine) and on other operating systems, such as Solaris and reportedly AIX. Ulrich is pushing for uniformity in application space, which is a reasonable position and one I have sympathy for. But Wget is not a Linux-only program, nor does it cater only to systems configured in a specially prescribed way. If we're certain that AI_ADDRCONFIG wouldn't hurt anyone, we can add it, but given Wget's flexibility in requesting and sorting addresses returned by DNS, I don't see a compelling reason to do it right now.
