[network] [PATCH 2/4] ip: restructure ip_net_is_valid