IPv6 Patch from http://www.fefe.de/ucspi/

The current version adds simple IPv6 support for tcpserver and tcpclient.

Note that IPv6 has inherent IPv4 compatibility, so IPv4 connections are still possible without having to start a second tcpserver or something like that. But since some systems may have IPv6 support in their libc but not in the kernel, my tcpserver will always try to create an IPv6 listening socket but will fall back to transparent IPv4 support. Note that this is done by the socket wrappers, not explicitly by tcpserver, so to tcpserver the connections look like a normal IPv4 mapped IPv6 connection.

If a client connects via IPv4 (and you don't use the new -6 option), tcpserver will make the environment variables look just like the unpatched version. tcpclient also has a -6 option now with the same effect.

IPv6 connections use $PROTO=TCP6, so clients can use this to see how they should try to parse the IP numbers given in the environment, should they feel the need to do so.

There is a new -4 option to tcpclient. I updated the resolver so that you can request an IPv6 address for a machine that has only an A record. If the lookup for an AAAA record fails, dns_ip6 will do an A lookup and convert the address(es) to IP4-mapped IPv6 addresses. If you want tcpclient to connect to the IPv4 address even if there is an AAAA record, you can use the -4 option to tcpclient.

What does not work yet?

There are quite a few servers using tcpserver out there. If they try to parse the IP addresses, they are not IPv6 ready and need to be touched.