From: Amitay Isaacs Date: Wed, 11 Jan 2017 05:49:33 +0000 (+1100) Subject: ctdb-takeover: Known and available IP lists should be the same size as nodemap X-Git-Tag: talloc-2.1.9~392 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7cfac778e8813b22d29859102bab1598cdb5ff0;p=thirdparty%2Fsamba.git 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 Reviewed-by: Martin Schwenke --- 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; }