diff options
| author | Amar Tumballi <amar@gluster.com> | 2011-06-08 09:28:49 +0000 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-06-08 11:17:12 -0700 | 
| commit | 19f375da5b43f940131623b2f33675aa2b3f5c8a (patch) | |
| tree | 29f5e51139deb1cfc2462a2a1ef64a100e2c1c4f /glusterfsd/src/glusterfsd.c | |
| parent | fe4eb7c3ac96218fe151633c5ccd34b7c0bea783 (diff) | |
fix multiple transport portmap issues in client handshake
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2294 (Currently there is no way through cli to make a volume listen on both the transports (socket/rdma))
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2294
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 14 | 
1 files changed, 13 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 2f535e6be2e..8e1e9ea6d9f 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -460,6 +460,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; @@ -678,8 +680,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;                  }  | 
