return tvals;
}
+static void clear_ipflags(struct ctdb_node_map *nodemap)
+{
+ int i;
+
+ for (i=0;i<nodemap->num;i++) {
+ nodemap->nodes[i].flags &=
+ ~(NODE_FLAGS_NOIPTAKEOVER|NODE_FLAGS_NOIPHOST);
+ }
+}
+
+
/* Set internal flags for IP allocation:
* Clear ip flags
* Set NOIPTAKOVER ip flags from per-node NoIPTakeover tunable
{
int i;
- /* Clear IP flags */
- for (i=0;i<nodemap->num;i++) {
- nodemap->nodes[i].flags &=
- ~(NODE_FLAGS_NOIPTAKEOVER|NODE_FLAGS_NOIPHOST);
- }
+ clear_ipflags(nodemap);
for (i=0;i<nodemap->num;i++) {
/* Can not take IPs on node with NoIPTakeover set */
/* Do the IP reassignment calculations */
ctdb_takeover_run_core(ctdb, nodemap, &all_ips);
+ /* The IP flags need to be cleared because they should never
+ * be seen outside the IP allocation code.
+ */
+ clear_ipflags(nodemap);
+
/* The recovery daemon does regular sanity checks of the IPs.
* However, sometimes it is overzealous and thinks changes are
* required when they're already underway. This stops the