Thomas Lussnig <[EMAIL PROTECTED]> writes:
> 1. Now if IPv6 enabled it only fetch IPv6 IPv4 sites faile
This is a problem, and part of the reason why the patch is so simple
in its current form. A correct patch must modify struct address_list
to hold a list of IP addresses, each of which can be either an IPv4
address or an IPv6 address. It could be something like:
struct ip_address {
enum { ADDR_IPV4, ADDR_IPV6 } type;
union {
ipv4_address ipv4;
ipv6_address ipv6;
} addr;
};
with the appropriate #ifdefs for when IPv6 is not available.
ipv6_address might also need to contain the "scope" information. (I
don't know what that is, but I trust that you do. I've been told that
IPv6 addresses were "scoped".)
The address_list_* functions should be modified to either return such
a data structure, *or* (perhaps simpler) to provide the way for the
caller to query which kind of address it's dealing with.
Another possibility is to store struct sockaddr_in instead of the
address. This was proposed by a Japanese developer, and I disliked
that idea because it seemed cleaner to store and pass only the
information we actually need. But perhaps this would be easier all
around, I don't know.
Also, you should get rid of the global variable named as vaguely as
`family'. Also, for FTP we need to support the extended IPv6
commands.
Your patch seems to introduce possibly non-portable functions such as
inet_pton and gethostbyname2 without checking whether they exist.
IPv6 support is not easy to add to an application heavily relying on
IPv4, such as Wget. I wouldn't say that your patch is "dirty" or
anything like it, but the fact is that in its current form it cannot
resemble the changes needed to fully support IPv6.