update ip() for ipv4/ipv6