"Herold Heiko" <[EMAIL PROTECTED]> said:

> Attached a little patch needed for current cvs in order to compile on
> windows nt 4 (any system without IPV6 really).

FYI, Wget/IPv6 on Windows do work somewhat; getaddrinfo()
is able to resolve a host to it's IPv6 address(es). But getnameinfo()
isn't able to convert it back to a presentation address. Same behaviour
as Linux w/o a IPv6 stack AFAICS.

Due to lack of inet_ntop() on Windows, I used this instead:

  struct sockaddr_in6 addr6;
  addr6.sin6_family = AF_INET6;
  memcpy (&addr6.sin6_addr, address, sizeof(addr6.sin6_addr));
  if (getnameinfo ((const struct sockaddr*)&addr6, sizeof(addr6),
                   buf, size, NULL, 0, NI_NUMERICHOST) == 0)
    return (buf);
  return (NULL);

but Wget doesn't check return value of inet_ntop(). Hint hint.
So the trace looks a bit weird:

>wget -d6 ftp://ftp.deepspace6.net/
Resolving ftp.deepspace6.net... seconds 0.00, ,
Caching ftp.deepspace6.net => 
Connecting to ftp.deepspace6.net||:21... failed: Address family not supported
Connecting to ftp.deepspace6.net||:21... failed: Address family not supported

Note Wget tries twice; once for each address in the list.
A little refinement would be to stop trying if the address-families
are the same.

--gv

Reply via email to