add a new serverid to send a message everytime an ip address is taken on the local...
[metze/ctdb/wip.git] / server / ctdb_takeover.c
index 193129445fbb3ea422ea544b0d385968dfd264a4..d7fb5ad5f0839093c836d46db341b854f7372abc 100644 (file)
@@ -331,6 +331,7 @@ static void ctdb_do_takeip_callback(struct ctdb_context *ctdb, int status,
        struct ctdb_do_takeip_state *state =
                talloc_get_type(private_data, struct ctdb_do_takeip_state);
        int32_t ret;
+       TDB_DATA data;
 
        if (status != 0) {
                if (status == -ETIME) {
@@ -351,6 +352,13 @@ static void ctdb_do_takeip_callback(struct ctdb_context *ctdb, int status,
                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));
+
+       ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_TAKE_IP, data);
+
+
        /* the control succeeded */
        ctdb_request_control_reply(ctdb, state->c, NULL, 0, NULL);
        talloc_free(state);