From c1efb801a41f5b870317b14703b8a1cfecc5c68c Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 12 Sep 2016 15:57:23 +1000 Subject: [PATCH] ctdb-ipalloc: Drop known_ips argument from merged IP list creation This is available in the IP allocation state. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/server/ipalloc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ctdb/server/ipalloc.c b/ctdb/server/ipalloc.c index ffec5e93ce0..e416c743c2d 100644 --- a/ctdb/server/ipalloc.c +++ b/ctdb/server/ipalloc.c @@ -106,8 +106,7 @@ static int getips_count_callback(void *param, void *data) * merged list of all public addresses needs to be built so that IP * allocation can be done. */ static struct public_ip_list * -create_merged_ip_list(struct ipalloc_state *ipalloc_state, - struct ctdb_public_ip_list *known_ips) +create_merged_ip_list(struct ipalloc_state *ipalloc_state) { int i, j; struct public_ip_list *ip_list; @@ -116,14 +115,14 @@ create_merged_ip_list(struct ipalloc_state *ipalloc_state, ip_tree = trbt_create(ipalloc_state, 0); - if (known_ips == NULL) { + if (ipalloc_state->known_public_ips == NULL) { DEBUG(DEBUG_ERR, ("Known public IPs not set\n")); return NULL; } for (i=0; i < ipalloc_state->num; i++) { - public_ips = &known_ips[i]; + public_ips = &ipalloc_state->known_public_ips[i]; for (j=0; j < public_ips->num; j++) { struct public_ip_list *tmp_ip; @@ -232,8 +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, - known_ips); + ipalloc_state->all_ips = create_merged_ip_list(ipalloc_state); return (ipalloc_state->all_ips != NULL); }