tools/ctdb: Disable the IP check in addip
authorMartin Schwenke <martin@meltin.net>
Thu, 13 Sep 2012 06:37:55 +0000 (16:37 +1000)
committerMartin Schwenke <martin@meltin.net>
Sat, 25 May 2013 22:57:03 +0000 (08:57 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
tools/ctdb.c

index b7b5e124e19a604e1fe65bec82a291d9626a4b28..0c2fbbe0da526e056c8a894260777bd74f138ece 100644 (file)
@@ -1765,6 +1765,8 @@ static int control_addip(struct ctdb_context *ctdb, int argc, const char **argv)
        struct ctdb_control_ip_iface *pub;
        TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
        struct ctdb_all_public_ips *ips;
+       uint32_t disable_time;
+       TDB_DATA data;
 
 
        if (argc != 2) {
@@ -1793,6 +1795,15 @@ static int control_addip(struct ctdb_context *ctdb, int argc, const char **argv)
        }
 
 
+       disable_time = 30;
+       data.dptr  = (uint8_t*)&disable_time;
+       data.dsize = sizeof(disable_time);
+       ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_DISABLE_IP_CHECK, data);
+       if (ret != 0) {
+               DEBUG(DEBUG_ERR,("Failed to send message to disable ipcheck\n"));
+               return -1;
+       }
+
 
        /* Dont timeout. This command waits for an ip reallocation
           which sometimes can take quite a while if there has