Add IPv6 support
Use IN6_IS_ADDR_V4MAPPED and reduce line count