summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_takeover_helper.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-01-11 16:49:33 +1100
committerMartin Schwenke <martins@samba.org>2017-01-12 19:25:23 +0100
commitb7cfac778e8813b22d29859102bab1598cdb5ff0 (patch)
treef1795baf2a4093a13d23341a31213fba36603598 /ctdb/server/ctdb_takeover_helper.c
parentd35ff9e9bdae79e5f5b2c9b5bf8cfe05199da804 (diff)
downloadsamba-b7cfac778e8813b22d29859102bab1598cdb5ff0.tar.gz
ctdb-takeover: Known and available IP lists should be the same size as nodemap
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12511 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/server/ctdb_takeover_helper.c')
-rw-r--r--ctdb/server/ctdb_takeover_helper.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ctdb/server/ctdb_takeover_helper.c b/ctdb/server/ctdb_takeover_helper.c
index f83b914db7d..d96e6c8605b 100644
--- a/ctdb/server/ctdb_takeover_helper.c
+++ b/ctdb/server/ctdb_takeover_helper.c
@@ -91,7 +91,7 @@ struct get_public_ips_state {
struct tevent_context *ev;
struct ctdb_client_context *client;
uint32_t *pnns;
- int count;
+ int count, num_nodes;
struct ctdb_public_ip_list *ips;
};
@@ -102,7 +102,7 @@ static struct tevent_req *get_public_ips_send(
struct tevent_context *ev,
struct ctdb_client_context *client,
uint32_t *pnns,
- int count,
+ int count, int num_nodes,
bool available_only)
{
struct tevent_req *req, *subreq;
@@ -116,6 +116,7 @@ static struct tevent_req *get_public_ips_send(
state->pnns = pnns;
state->count = count;
+ state->num_nodes = num_nodes;
state->ips = NULL;
ctdb_req_control_get_public_ips(&request, available_only);
@@ -164,7 +165,7 @@ static void get_public_ips_done(struct tevent_req *subreq)
}
state->ips = talloc_zero_array(state, struct ctdb_public_ip_list,
- state->count);
+ state->num_nodes);
if (tevent_req_nomem(state->ips, req)) {
return;
}
@@ -832,7 +833,7 @@ static void takeover_nodemap_done(struct tevent_req *subreq)
subreq = get_public_ips_send(state, state->ev, state->client,
state->pnns_active, state->num_active,
- false);
+ state->num_nodes, false);
if (tevent_req_nomem(subreq, req)) {
return;
}
@@ -860,7 +861,7 @@ static void takeover_known_ips_done(struct tevent_req *subreq)
subreq = get_public_ips_send(state, state->ev, state->client,
state->pnns_active, state->num_active,
- true);
+ state->num_nodes, true);
if (tevent_req_nomem(subreq, req)) {
return;
}