add ipv6 support, bug fixes