merge get_ipv4_address code