diff --git a/ctdb/server/ipalloc.c b/ctdb/server/ipalloc.c index e416c743c2d..7fd422a765a 100644 --- a/ctdb/server/ipalloc.c +++ b/ctdb/server/ipalloc.c @@ -231,9 +231,7 @@ bool ipalloc_set_public_ips(struct ipalloc_state *ipalloc_state, ipalloc_state->available_public_ips = available_ips; ipalloc_state->known_public_ips = known_ips; - ipalloc_state->all_ips = create_merged_ip_list(ipalloc_state); - - return (ipalloc_state->all_ips != NULL); + return true; } /* This can only return false if there are no available IPs *and* @@ -282,6 +280,11 @@ struct public_ip_list *ipalloc(struct ipalloc_state *ipalloc_state) { bool ret = false; + ipalloc_state->all_ips = create_merged_ip_list(ipalloc_state); + if (ipalloc_state->all_ips == NULL) { + return NULL; + } + switch (ipalloc_state->algorithm) { case IPALLOC_LCP2: ret = ipalloc_lcp2(ipalloc_state);