support ipv6 (thanks Jörg Thalheim for the suggestion)