return;
}
+ if (ctdb->do_checkpublicip) {
+
ret = ctdb_announce_vnn_iface(ctdb, state->vnn);
if (ret != 0) {
ctdb_request_control_reply(ctdb, state->c, NULL, -1, NULL);
return;
}
+ }
+
data.dptr = (uint8_t *)ctdb_addr_to_str(&state->vnn->public_address);
data.dsize = strlen((char *)data.dptr) + 1;
DEBUG(DEBUG_INFO,(__location__ " sending TAKE_IP for '%s'\n", data.dptr));
return;
}
+ if (ctdb->do_checkpublicip) {
+
ret = ctdb_announce_vnn_iface(ctdb, state->vnn);
if (ret != 0) {
ctdb_request_control_reply(ctdb, state->c, NULL, -1, NULL);
return;
}
+ }
+
/* the control succeeded */
ctdb_request_control_reply(ctdb, state->c, NULL, 0, NULL);
talloc_free(state);
return 0;
}
- have_ip = ctdb_sys_have_ip(&pip->addr);
+ if (ctdb->do_checkpublicip) {
+ have_ip = ctdb_sys_have_ip(&pip->addr);
+ }
best_iface = ctdb_vnn_best_iface(ctdb, vnn);
if (best_iface == NULL) {
DEBUG(DEBUG_ERR,("takeoverip of IP %s/%u failed to find"
have_ip = false;
}
+
if (vnn->iface == NULL && have_ip) {
DEBUG(DEBUG_CRIT,(__location__ " takeoverip of IP %s is known to the kernel, "
"but we have no interface assigned, has someone manually configured it? Ignore for now.\n",
talloc_free(vnn->takeover_ctx);
vnn->takeover_ctx = NULL;
- if (!ctdb_sys_have_ip(&pip->addr)) {
- DEBUG(DEBUG_DEBUG,("Redundant release of IP %s/%u on interface %s (ip not held)\n",
- ctdb_addr_to_str(&pip->addr),
- vnn->public_netmask_bits,
- ctdb_vnn_iface_string(vnn)));
- ctdb_vnn_unassign_iface(ctdb, vnn);
- return 0;
- }
+ if (ctdb->do_checkpublicip) {
- if (vnn->iface == NULL) {
- DEBUG(DEBUG_ERR,(__location__ " release_ip of IP %s is known to the kernel, "
- "but we have no interface assigned, has someone manually configured it? Ignore for now.\n",
- ctdb_addr_to_str(&vnn->public_address)));
+ if (!ctdb_sys_have_ip(&pip->addr)) {
+ DEBUG(DEBUG_DEBUG,("Redundant release of IP %s/%u on interface %s (ip not held)\n",
+ ctdb_addr_to_str(&pip->addr),
+ vnn->public_netmask_bits,
+ ctdb_vnn_iface_string(vnn)));
+ ctdb_vnn_unassign_iface(ctdb, vnn);
+ return 0;
+ }
+
+ if (vnn->iface == NULL) {
+ DEBUG(DEBUG_ERR,(__location__ " release_ip of IP %s is known to the kernel, "
+ "but we have no interface assigned, has someone manually configured it? Ignore for now.\n",
+ ctdb_addr_to_str(&vnn->public_address)));
+ return 0;
+ }
+
+ } else if (vnn->iface == NULL) {
+ DEBUG(DEBUG_ERR, ("No interface found for IP %s.\n",
+ ctdb_addr_to_str(&vnn->public_address)));
return 0;
}
}
- ctdb_start_monitoring_interfaces(ctdb);
+ if (ctdb->do_checkpublicip) {
+ ctdb_start_monitoring_interfaces(ctdb);
+ }
talloc_free(lines);
return 0;