IPv4/6 functions back and forth