summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2017-01-27 14:43:34 +1100
committerMartin Schwenke <martins@samba.org>2017-02-24 07:47:11 +0100
commitf7f23dca09418da82d076bd25fb1fa4c328ba76d (patch)
treeba5f0f66f89a919c462969bb497e725db43db261 /ctdb
parent42bcfa6a51cd829304742fd3aa70d8958c5b10fe (diff)
downloadsamba-f7f23dca09418da82d076bd25fb1fa4c328ba76d.tar.gz
ctdb-takeover: Short circuit if fetching IPs from no nodes
The current code will fetch IP from all connected and all active nodes, so this can't happen. However, catch it anyway in case the calling code changes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_takeover_helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_takeover_helper.c b/ctdb/server/ctdb_takeover_helper.c
index 796d45cc4a7..05397051085 100644
--- a/ctdb/server/ctdb_takeover_helper.c
+++ b/ctdb/server/ctdb_takeover_helper.c
@@ -122,6 +122,12 @@ static struct tevent_req *get_public_ips_send(
return tevent_req_post(req, ev);
}
+ /* Short circuit if no nodes being asked for IPs */
+ if (state->count == 0) {
+ tevent_req_done(req);
+ return tevent_req_post(req, ev);
+ }
+
ctdb_req_control_get_public_ips(&request, available_only);
subreq = ctdb_client_control_multi_send(mem_ctx, ev, client,
state->pnns,