def process_route_spec_config(con, vpc_info, route_spec,
                              failed_ips, questionable_ips):
    """
    Look through the route spec and update routes accordingly.

    Idea: Make sure we have a route for each CIDR.

    If we have a route to any of the IP addresses for a given CIDR then we are
    good. Otherwise, pick one (usually the first) IP and create a route to that
    IP.

    If a route points at a failed or questionable IP then a new candidate is
    chosen, if possible.

    """
    if CURRENT_STATE._stop_all:
        logging.debug("Routespec processing. Stop requested, abort operation")
        return

    if failed_ips:
        logging.debug("Route spec processing. Failed IPs: %s" %
                      ",".join(failed_ips))
    else:
        logging.debug("Route spec processing. No failed IPs.")

    # Iterate over all the routes in the VPC, check they are contained in
    # the spec, update the routes as needed.

    # Need to remember the routes we saw in different RTs, so that we can later
    # add them, if needed.
    routes_in_rts  = {}

    CURRENT_STATE.vpc_state.setdefault("time",
                                       datetime.datetime.now().isoformat())

    # Passed through the functions and filled in, state accumulates information
    # about all the routes we encounted in the VPC and what we are doing with
    # them. This is then available in the CURRENT_STATE
    chosen_routers = _update_existing_routes(route_spec,
                                             failed_ips, questionable_ips,
                                             vpc_info, con, routes_in_rts)

    # Now go over all the routes in the spec and add those that aren't in VPC,
    # yet.
    _add_missing_routes(route_spec, failed_ips, questionable_ips,
                        chosen_routers,
                        vpc_info, con, routes_in_rts)
Look through the route spec and update routes accordingly.

    Idea: Make sure we have a route for each CIDR.

    If we have a route to any of the IP addresses for a given CIDR then we are
    good. Otherwise, pick one (usually the first) IP and create a route to that
    IP.

    If a route points at a failed or questionable IP then a new candidate is
    chosen, if possible.