IPv6 enabled Cygwin

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Jul 6 14:39:00 GMT 2006


Hi,

for the daring amongst you, I have created a CVS branch called
"cv-branch", relative to the winsup directory(*).

So far, it contains three patches which would be quite happy to get
tested and, that's the exciting part, to get debugged and maybe even
patched by others.

The first patch is rather boring.  As described on the main list in
http://cygwin.com/ml/cygwin/2006-07/msg00129.html, Cygwin only asks the
PDC when it tries to figure out the domain group list of a domain user.
I've changed that to a somewhat more fault-tolerant method.
get_logon_server is now using the DsGetDcName function now on systems
having that function (2K+, as well as 9x/NT4 with DSClient patch),
falling back to NetGetDCName/NetGetAnyDCName if not.  The problem is
that the function might return a server name of a server, which isn't
available.  This is only discovered after trying to contact the server
in a subsequent call to NetUserGetGroups.  When that happens,
get_logon_server is called again with the "rediscover" flag set, trying
harder to get a suitable DC.  Only if that fails, the whole
functionality of getting the domain groups from a DC fails.

What's far more interesting is the new socket stuff.  I have enabled
IPv6 in Cygwin now.  The inet_ntop/inet_pton functions are replaced by
v6-aware functions (kudos to Paul Vixie).  Now finally implemented are
getaddrinfo/getnameinfo/freeaddrinfo.  These functions are trying to use
the WinSock functions if they are available (XP+, as well as 2K with
IPv6 technology preview).  If they can't be found, Cygwin falls back to
using the W. Richard Stevens (kudos, kudos, kudos!) versions of these
functions, which are used here as IPv4-only.  It's not possible to use
the IPv6 functions unfortunately, since they would require a
Cygwin-internal implementation of the resolver lib.

Additionally, I tried to fix all code in net.cc and fhandler_socket.cc
which would handle AF_INET6 incorrectly.  I could have easily overlooked
something, so I'd be glad for patches or even just reports.  Also, if
stuff is missing in headers ==> patches, reports.

Last but not least a tiny patch which could be missed easily.  I have
changed socketpair so that the listening socket is only bound to the
loopback address, so that only a loopback connect can (and should)
connect.  If this results into problems, yell.

Btw., if somebody's missing AF_INET6 handling in socketpair, that's
deliberately.  It's perfeclyt valid not to support all address families.
Linux, for instance, only supports AF_LOCAL.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list