Move non-trivial ret_* functions to ipaddr.c too.