From 5d67526f6028d75a57056dc83d2e3086cec8779b Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Tue, 28 Aug 2012 18:11:43 +0530 Subject: cli/: Filter out the loopback address for brick creation. Don't create the volumes with brick address 0.0.0.0 to 0.255.255.255 (http://en.wikipedia.org/wiki/Reserved_IP_addresses) Change-Id: Ic5464ec370bddf498a5220acf2d367b877e21e66 BUG: 787627 Signed-off-by: Varun Shastry Reviewed-on: http://review.gluster.org/3865 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-parser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 322d4d9ad07..3b81792dc2c 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -97,9 +97,11 @@ cli_cmd_bricks_parse (const char **words, int wordcount, int brick_index, } if (!(strcmp (host_name, "localhost") && - strcmp (host_name, "127.0.0.1"))) { + strcmp (host_name, "127.0.0.1") && + strncmp (host_name, "0.", 2))) { cli_err ("Please provide a valid hostname/ip other " - "than localhost or 127.0.0.1"); + "than localhost, 127.0.0.1 or loopback " + "address (0.0.0.0 to 0.255.255.255)."); ret = -1; GF_FREE (tmp_host); goto out; -- cgit