Skip to content

Commit

Permalink
ctdb-ipalloc: Whether IPs can be hosted need not depend on merged IP …
Browse files Browse the repository at this point in the history
…list

Merged IP list won't be available here...

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Martin Schwenke committed Sep 14, 2016
1 parent 0e5c62d commit dfc3b88
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ctdb/server/ipalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,18 @@ bool ipalloc_set_public_ips(struct ipalloc_state *ipalloc_state,
bool ipalloc_can_host_ips(struct ipalloc_state *ipalloc_state)
{
int i;
struct public_ip_list *ip_list;


for (ip_list = ipalloc_state->all_ips;
ip_list != NULL;
ip_list = ip_list->next) {
if (ip_list->pnn != -1) {
return true;
for (i=0; i < ipalloc_state->num; i++) {
struct ctdb_public_ip_list *ips =
ipalloc_state->known_public_ips;
if (ips[i].num != 0) {
int j;
/* Succeed if an address is hosted on node i */
for (j=0; j < ips[i].num; j++) {
if (ips[i].ip[j].pnn == i) {
return true;
}
}
}
}

Expand Down

0 comments on commit dfc3b88

Please sign in to comment.