1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2016-09-12 15:57:23 +10:00 committed by Martin Schwenke
parent fed251726f
commit c1efb801a4

View File

@ -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);
}