On Thursday 11 December 2003 13:51, you wrote: > Mauro Tortonesi <[EMAIL PROTECTED]> writes: > > yes, you're right. using IPV6_V6ONLY with client sockets is probably > > looking for troubles. > > In that case, I lean towards removing the code that sets the option.
i agree. > > for consistency, i think we should simply reject [the mapped > > addresses]. > > I think Wget should completely avoid handling this explicitly or > setting any kind of policies in this matter. You never know what > people might want to do with Wget. > > lookup_host and friends are complex enough as they are; there is IMHO > no need to make them more complex, at least not without a good reason. > > Thanks for looking into this. IMVHO, lookup_host does the right thing: ifdef ENABLE_IPV6 { int err; struct addrinfo hints, *res; xzero (hints); hints.ai_socktype = SOCK_STREAM; if (opt.ipv4_only) hints.ai_family = AF_INET; else if (opt.ipv6_only) hints.ai_family = AF_INET6; else { hints.ai_family = AF_UNSPEC; #ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; #else /* On systems without AI_ADDRCONFIG, emulate it by manually checking whether the system supports IPv6 sockets and. */ if (!socket_has_inet6 ()) hints.ai_family = AF_INET; #endif } if (flags & LH_BIND) hints.ai_flags |= AI_PASSIVE; if opt.ipv6_only is set, getaddrinfo returns only true (non IPv4-mapped) IPv6 addresses, which IMVHO is just the correct semantic behaviour: people that use the -6 option do not expect wget to establish IPv4 connections using IPv4-mapped IPv6 addresses. however, we could add a --accept-v4-mapped-addresses option that allows wget to use also IPv4-mapped addresses. i think this is a feature that could be useful for some wget users. the change to lookup_host is trivial: ifdef ENABLE_IPV6 { int err; struct addrinfo hints, *res; xzero (hints); hints.ai_socktype = SOCK_STREAM; if (opt.ipv4_only) hints.ai_family = AF_INET; else if (opt.ipv6_only) hints.ai_family = AF_INET6; else { hints.ai_family = AF_UNSPEC; #ifdef HAVE_GETADDRINFO_AI_ADDRCONFIG hints.ai_flags |= AI_ADDRCONFIG; #else /* On systems without AI_ADDRCONFIG, emulate it by manually checking whether the system supports IPv6 sockets and. */ if (!socket_has_inet6 ()) hints.ai_family = AF_INET; #endif #ifdef HAVE_GETADDRINFO_AI_V4MAPPED if (opt.use_v4mapped_addrs) { hints.ai_flags |= AI_V4MAPPED; #ifdef HAVE_GETADDRINFO_AI_ALL hints.ai_flags |= AI_ALL; #endif } #endif } if (flags & LH_BIND) hints.ai_flags |= AI_PASSIVE; however, the --accept-v4-mapped-addresses option should *NOT* be enabled by default. -- Aequam memento rebus in arduis servare mentem... Mauro Tortonesi [EMAIL PROTECTED] [EMAIL PROTECTED] Deep Space 6 - IPv6 on Linux http://www.deepspace6.net Ferrara Linux Users Group http://www.ferrara.linux.it