summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-17 06:10:53 +0000
committerAnand Avati <avati@gluster.com>2011-06-19 02:16:34 -0700
commita6fd403a15ffead93daba8a737cd7c6d6a943744 (patch)
tree618fd1c03ead241bb4605a774e55c14425c2c026 /glusterfsd/src/glusterfsd.c
parent3d6efb17f12fa23482936ec7a5a666bbf9c0f78b (diff)
fix multiple transport related portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2258 (enhance gluster volume rebalance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2258
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 87d16c7dcf9..f17ac814eb9 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -426,6 +426,8 @@ parse_opts (int key, char *arg, struct argp_state *state)
gf_boolean_t b = _gf_false;
char *pwd = NULL;
char tmp_buf[2048] = {0,};
+ char *tmp_str = NULL;
+ char *port_str = NULL;
cmd_args = state->input;
@@ -657,8 +659,18 @@ parse_opts (int key, char *arg, struct argp_state *state)
case ARGP_BRICK_PORT_KEY:
n = 0;
- if (gf_string2uint_base10 (arg, &n) == 0) {
+ port_str = strtok_r (arg, ",", &tmp_str);
+ if (gf_string2uint_base10 (port_str, &n) == 0) {
cmd_args->brick_port = n;
+ port_str = strtok_r (NULL, ",", &tmp_str);
+ if (port_str) {
+ if (gf_string2uint_base10 (port_str, &n) == 0)
+ cmd_args->brick_port2 = n;
+ break;
+
+ argp_failure (state, -1, 0,
+ "wrong brick (listen) port %s", arg);
+ }
break;
}