1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

ctdbd: Fix ctdb_control_release_ip() on local daemons

When running on local daemons no IPs are actually assigned to
interfaces.  Commit 9a806dec8687e2ec08a308853b61af6aed5e5d1e broke
ctdb_control_release_ip() for local daemons because it asks the system
which interface the given IP is on, instead of the old behaviour of
trusting CTDB's internal records.

For local deamons (i.e. !ctdb->do_checkpublicip) revert to the old
behaviour of looking up the interface internally.  This is good
enough, given that the tests don't tend to misconfigure the addresses.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 38e8651b955afdbaf0ae87c24c55c052f8209290)
This commit is contained in:
Martin Schwenke 2012-07-02 14:09:32 +10:00 committed by Amitay Isaacs
parent 748c3d7eb6
commit 75a0041567

View File

@ -819,12 +819,20 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
ctdb_vnn_unassign_iface(ctdb, vnn);
return 0;
}
}
iface = ctdb_sys_find_ifname(&pip->addr);
if (iface == NULL) {
DEBUG(DEBUG_ERR, ("Could not find which interface the ip address is hosted on. can not release it\n"));
return 0;
iface = ctdb_sys_find_ifname(&pip->addr);
if (iface == NULL) {
DEBUG(DEBUG_ERR, ("Could not find which interface the ip address is hosted on. can not release it\n"));
return 0;
}
} else {
if (vnn->iface == NULL) {
DEBUG(DEBUG_DEBUG,("Redundant release of IP %s/%u (ip not held)\n",
ctdb_addr_to_str(&pip->addr),
vnn->public_netmask_bits));
return 0;
}
iface = strdup(ctdb_vnn_iface_string(vnn));
}
DEBUG(DEBUG_NOTICE,("Release of IP %s/%u on interface %s node:%d\n",