On Wednesday 20 April 2005 05:12 am, Hrvoje Niksic wrote: > Mauro Tortonesi <[EMAIL PROTECTED]> writes: > > well, to defend myself, i have to say that nc6 handles the -4 and -6 > > switches by simply setting the ai_family member of the hints struct > > to be passed to getaddrinfo to PF_INET6 and PF_INET respectively, > > instead of the PF_UNSPEC default. so, the behaviour of -4 and -6 > > switches with numeric addresses in nc6 is just a byproduct of this > > simple assignement. ;-) > > But so does Wget! Take a look at the code: > > 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; > hints.ai_flags |= AI_ADDRCONFIG; > } > > That's why I am surprised at the different behavior.
sorry, i forgot to tell you that when the -6 switch is used, nc6 also sets the IPV6_V6ONLY option for the PF_INET6 socket used in the communication. that's why IPv4-compatible addresses are rejected. -- Aequam memento rebus in arduis servare mentem... Mauro Tortonesi University of Ferrara - Dept. of Eng. http://www.ing.unife.it Institute of Human & Machine Cognition http://www.ihmc.us Deep Space 6 - IPv6 for Linux http://www.deepspace6.net Ferrara Linux User Group http://www.ferrara.linux.it