ctdb-tools: Drop ipiface command from ctdb tool
authorAmitay Isaacs <amitay@gmail.com>
Thu, 8 Mar 2018 03:19:19 +0000 (14:19 +1100)
committerMartin Schwenke <martins@samba.org>
Fri, 9 Mar 2018 06:08:23 +0000 (07:08 +0100)
This command is not used anywhere and also does not work for IPv6
addresses.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/doc/ctdb.1.xml
ctdb/tools/ctdb.c

index 8dfca3b1a498bd8bebab9fe869e8323667f1a0a3..3103d62cc1f22c4019d008b8041ea75bb1e7d8d7 100644 (file)
@@ -1834,7 +1834,7 @@ HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/li
   <!-- UNDOCUMENTED: stats
        isnotrecmaster addtickle deltickle
        tfetch tstore readkey writekey
-       checktcpport getdbseqnum ipiface
+       checktcpport getdbseqnum
   -->
 
   <refsect1>
index 8535c784c9388bd54ddbc58e45062a467055495e..fa8d880335ab1659d0513524ad87dedd953588fc 100644 (file)
@@ -5870,34 +5870,6 @@ static int control_reloadips(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
        return ipreallocate(mem_ctx, ctdb);
 }
 
-static int control_ipiface(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
-                          int argc, const char **argv)
-{
-       ctdb_sock_addr addr;
-       char *iface;
-       int ret;
-
-       if (argc != 1) {
-               usage("ipiface");
-       }
-
-       ret = ctdb_sock_addr_from_string(argv[0], &addr, false);
-       if (ret != 0) {
-               fprintf(stderr, "Failed to Parse IP %s\n", argv[0]);
-               return 1;
-       }
-
-       iface = ctdb_sys_find_ifname(&addr);
-       if (iface == NULL) {
-               fprintf(stderr, "Failed to find interface for IP %s\n",
-                       argv[0]);
-               return 1;
-       }
-       free(iface);
-
-       return 0;
-}
-
 
 static const struct ctdb_cmd {
        const char *name;
@@ -6065,8 +6037,6 @@ static const struct ctdb_cmd {
                "show database statistics", "<dbname|dbid>" },
        { "reloadips", control_reloadips, false, false,
                "reload the public addresses file", "[all|<pnn-list>]" },
-       { "ipiface", control_ipiface, true, false,
-               "Find the interface an ip address is hosted on", "<ip>" },
 };
 
 static const struct ctdb_cmd *match_command(const char *command)