This is unnecessary. IP allocation state already has a node count and
"i" is already a PNN.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
return NULL;
}
- for (i=0; i < ctdb->num_nodes; i++) {
+ for (i=0; i < ipalloc_state->num; i++) {
public_ips = &ipalloc_state->known_public_ips[i];
CTDB_NO_MEMORY_NULL(ctdb, tmp_ip);
/* Do not use information about IP addresses hosted
* on other nodes, it may not be accurate */
- if (public_ips->ip[j].pnn == ctdb->nodes[i]->pnn) {
+ if (public_ips->ip[j].pnn == i) {
tmp_ip->pnn = public_ips->ip[j].pnn;
} else {
tmp_ip->pnn = -1;