net.c: Add support for IPv6 connections

You can now successfully connect to an IPv6 hub, but stuff like
searching and file sharing doesn't work yet.